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) {
|
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';
|
let variant = 'danger';
|
||||||
|
|
||||||
if (message.includes('incompatible') || message.includes('format')) {
|
if (message.includes('incompatible') || message.includes('format')) {
|
||||||
@@ -125,8 +133,6 @@ export default () => ({
|
|||||||
duration: 8000,
|
duration: 8000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$dispatch('auth-error', {message, variant});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|||||||
@@ -306,8 +306,7 @@ class extends Component {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="flex min-h-screen" x-data="nostrLogin"
|
<div class="flex min-h-screen" x-data="nostrLogin"
|
||||||
x-init="initErrorPolling"
|
x-init="initErrorPolling">
|
||||||
x-on:auth-error.window="showAuthError($event.detail)">
|
|
||||||
<div class="flex-1 flex justify-center items-center">
|
<div class="flex-1 flex justify-center items-center">
|
||||||
<div class="w-80 max-w-80 space-y-6">
|
<div class="w-80 max-w-80 space-y-6">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
|
|||||||
Reference in New Issue
Block a user