mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-05 04:54:53 +00:00
✨ **Nostr Login:** Enhanced error handling and removed unused auth-error event binding.
This commit is contained in:
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user