**Nostr Login:** Enhanced error handling and removed unused auth-error event binding.

This commit is contained in:
BT
2026-05-03 23:41:49 +02:00
parent 0f26bae9a6
commit bd7d39c1d7
2 changed files with 10 additions and 5 deletions
+9 -3
View File
@@ -106,7 +106,15 @@ export default () => ({
},
showAuthError(error) {
let message = error || 'Authentication failed. Please try again.';
let message;
if (typeof error === 'string') {
message = error;
} else if (error && typeof error === 'object' && typeof error.message === 'string') {
message = error.message;
} else {
message = 'Authentication failed. Please try again.';
}
let variant = 'danger';
if (message.includes('incompatible') || message.includes('format')) {
@@ -125,8 +133,6 @@ export default () => ({
duration: 8000,
});
}
this.$dispatch('auth-error', {message, variant});
},
destroy() {
@@ -306,8 +306,7 @@ class extends Component {
?>
<div class="flex min-h-screen" x-data="nostrLogin"
x-init="initErrorPolling"
x-on:auth-error.window="showAuthError($event.detail)">
x-init="initErrorPolling">
<div class="flex-1 flex justify-center items-center">
<div class="w-80 max-w-80 space-y-6">
<!-- Logo -->