mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 06:49:37 +02:00
Add multi-factor authentication (MFA) support; update localization and error handling
This commit is contained in:
parent
1b54f8ed69
commit
9bf0849b92
15 changed files with 369 additions and 68 deletions
|
@ -12,6 +12,7 @@ django-resized
|
|||
django-geojson
|
||||
setuptools
|
||||
gunicorn==23.0.0
|
||||
qrcode==8.0
|
||||
# slippers==0.6.2
|
||||
# django-allauth-ui==1.5.1
|
||||
# django-widget-tweaks==1.5.0
|
|
@ -53,18 +53,10 @@
|
|||
}
|
||||
|
||||
async function sendTotp() {
|
||||
console.log('sending totp');
|
||||
|
||||
let sessionid = document.cookie
|
||||
.split('; ')
|
||||
.find((row) => row.startsWith('sessionid'))
|
||||
?.split('=')[1];
|
||||
|
||||
const res = await fetch('/_allauth/browser/v1/account/authenticators/totp', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Cookie: `sessionid=${sessionid}`
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
code: first_code
|
||||
|
@ -73,7 +65,7 @@
|
|||
});
|
||||
console.log(res);
|
||||
if (res.ok) {
|
||||
addToast('success', '2FA enabled');
|
||||
addToast('success', $t('settings.mfa_enabled'));
|
||||
is_enabled = true;
|
||||
getRecoveryCodes();
|
||||
} else {
|
||||
|
@ -125,10 +117,10 @@
|
|||
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<div class="modal-box" role="dialog" on:keydown={handleKeydown} tabindex="0">
|
||||
<h3 class="font-bold text-lg">Enable 2FA</h3>
|
||||
<h3 class="font-bold text-lg">{$t('settings.enable_mfa')}</h3>
|
||||
|
||||
{#if qrCodeDataUrl}
|
||||
<div class="mb-4 flex items-center justify-center">
|
||||
<div class="mb-4 flex items-center justify-center mt-2">
|
||||
<img src={qrCodeDataUrl} alt="QR Code" class="w-64 h-64" />
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -141,7 +133,8 @@
|
|||
class="input input-bordered w-full max-w-xs"
|
||||
readonly
|
||||
/>
|
||||
<button class="btn btn-primary ml-2" on:click={() => copyToClipboard(secret)}>Copy</button
|
||||
<button class="btn btn-primary ml-2" on:click={() => copyToClipboard(secret)}
|
||||
>{$t('settings.copy')}</button
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -149,20 +142,20 @@
|
|||
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Authenticator Code"
|
||||
placeholder={$t('settings.authenticator_code')}
|
||||
class="input input-bordered w-full max-w-xs"
|
||||
bind:value={first_code}
|
||||
/>
|
||||
|
||||
<div class="recovery-codes-container">
|
||||
{#if recovery_codes.length > 0}
|
||||
<h3 class="mt-4 text-center font-bold text-lg">Recovery Codes</h3>
|
||||
<h3 class="mt-4 text-center font-bold text-lg">{$t('settings.recovery_codes')}</h3>
|
||||
<p class="text-center text-lg mb-2">
|
||||
These are your recovery codes. Keep them safe. You will not be able to see them again.
|
||||
{$t('settings.recovery_codes_desc')}
|
||||
</p>
|
||||
<button
|
||||
class="btn btn-primary ml-2"
|
||||
on:click={() => copyToClipboard(recovery_codes.join(', '))}>Copy</button
|
||||
on:click={() => copyToClipboard(recovery_codes.join(', '))}>{$t('settings.copy')}</button
|
||||
>
|
||||
{/if}
|
||||
<div class="recovery-codes-grid flex flex-wrap">
|
||||
|
@ -178,12 +171,12 @@
|
|||
|
||||
{#if reauthError}
|
||||
<div class="alert alert-error mt-4">
|
||||
Please logout and back in to refresh your session and try again.
|
||||
{$t('settings.reset_session_error')}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if !is_enabled}
|
||||
<button class="btn btn-primary mt-4" on:click={sendTotp}>Enable 2FA</button>
|
||||
<button class="btn btn-primary mt-4" on:click={sendTotp}>{$t('settings.enable_mfa')}</button>
|
||||
{/if}
|
||||
|
||||
<button class="btn btn-primary mt-4" on:click={close}>{$t('about.close')}</button>
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "Fügen Sie ein Tag hinzu",
|
||||
"tags": "Schlagworte",
|
||||
"set_to_pin": "Auf „Anpinnen“ setzen",
|
||||
"category_fetch_error": "Fehler beim Abrufen der Kategorien"
|
||||
"category_fetch_error": "Fehler beim Abrufen der Kategorien",
|
||||
"copied_to_clipboard": "In die Zwischenablage kopiert!",
|
||||
"copy_failed": "Das Kopieren ist fehlgeschlagen"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "Meine Tags",
|
||||
"tag": "Etikett",
|
||||
"language_selection": "Sprache",
|
||||
"support": "Unterstützung"
|
||||
"support": "Unterstützung",
|
||||
"calendar": "Kalender"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Passwort bestätigen",
|
||||
|
@ -250,7 +253,8 @@
|
|||
"username": "Benutzername",
|
||||
"profile_picture": "Profilbild",
|
||||
"public_profile": "Öffentliches Profil",
|
||||
"public_tooltip": "Mit einem öffentlichen Profil können Benutzer Sammlungen mit Ihnen teilen und Ihr Profil auf der Benutzerseite anzeigen."
|
||||
"public_tooltip": "Mit einem öffentlichen Profil können Benutzer Sammlungen mit Ihnen teilen und Ihr Profil auf der Benutzerseite anzeigen.",
|
||||
"email_required": "E-Mail ist erforderlich"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Keine Benutzer mit öffentlichen Profilen gefunden."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "Foto von",
|
||||
"change_password_error": "Passwort kann nicht geändert werden. \nUngültiges aktuelles Passwort oder ungültiges neues Passwort.",
|
||||
"current_password": "Aktuelles Passwort",
|
||||
"password_change_lopout_warning": "Nach der Passwortänderung werden Sie abgemeldet."
|
||||
"password_change_lopout_warning": "Nach der Passwortänderung werden Sie abgemeldet.",
|
||||
"authenticator_code": "Authentifikatorcode",
|
||||
"copy": "Kopie",
|
||||
"disable_mfa": "Deaktivieren Sie MFA",
|
||||
"email_added": "E-Mail erfolgreich hinzugefügt!",
|
||||
"email_added_error": "Fehler beim Hinzufügen der E-Mail",
|
||||
"email_removed": "E-Mail erfolgreich entfernt!",
|
||||
"email_removed_error": "Fehler beim Entfernen der E-Mail",
|
||||
"email_set_primary": "E-Mail erfolgreich als primäre E-Mail-Adresse festgelegt!",
|
||||
"email_set_primary_error": "Fehler beim Festlegen der E-Mail-Adresse als primär",
|
||||
"email_verified": "E-Mail erfolgreich bestätigt!",
|
||||
"email_verified_erorr_desc": "Ihre E-Mail-Adresse konnte nicht bestätigt werden. \nBitte versuchen Sie es erneut.",
|
||||
"email_verified_error": "Fehler bei der E-Mail-Bestätigung",
|
||||
"email_verified_success": "Ihre E-Mail-Adresse wurde bestätigt. \nSie können sich jetzt anmelden.",
|
||||
"enable_mfa": "Aktivieren Sie MFA",
|
||||
"error_change_password": "Fehler beim Ändern des Passworts. \nBitte überprüfen Sie Ihr aktuelles Passwort und versuchen Sie es erneut.",
|
||||
"generic_error": "Bei der Bearbeitung Ihrer Anfrage ist ein Fehler aufgetreten.",
|
||||
"invalid_code": "Ungültiger MFA-Code",
|
||||
"invalid_credentials": "Ungültiger Benutzername oder Passwort",
|
||||
"make_primary": "Machen Sie primär",
|
||||
"mfa_disabled": "Multi-Faktor-Authentifizierung erfolgreich deaktiviert!",
|
||||
"mfa_enabled": "Multi-Faktor-Authentifizierung erfolgreich aktiviert!",
|
||||
"mfa_not_enabled": "MFA ist nicht aktiviert",
|
||||
"mfa_page_title": "Multi-Faktor-Authentifizierung",
|
||||
"mfa_required": "Eine Multi-Faktor-Authentifizierung ist erforderlich",
|
||||
"no_emai_set": "Keine E-Mail-Adresse festgelegt",
|
||||
"not_verified": "Nicht verifiziert",
|
||||
"primary": "Primär",
|
||||
"recovery_codes": "Wiederherstellungscodes",
|
||||
"recovery_codes_desc": "Dies sind Ihre Wiederherstellungscodes. \nBewahren Sie sie sicher auf. \nSie werden sie nicht mehr sehen können.",
|
||||
"reset_session_error": "Bitte melden Sie sich ab und wieder an, um Ihre Sitzung zu aktualisieren, und versuchen Sie es erneut.",
|
||||
"verified": "Verifiziert",
|
||||
"verify": "Verifizieren",
|
||||
"verify_email_error": "Fehler bei der E-Mail-Bestätigung. \nVersuchen Sie es in ein paar Minuten noch einmal.",
|
||||
"verify_email_success": "E-Mail-Bestätigung erfolgreich gesendet!"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Artikel hinzufügen",
|
||||
|
|
|
@ -315,7 +315,25 @@
|
|||
"make_primary": "Make Primary",
|
||||
"verify": "Verify",
|
||||
"no_emai_set": "No email set",
|
||||
"error_change_password": "Error changing password. Please check your current password and try again."
|
||||
"error_change_password": "Error changing password. Please check your current password and try again.",
|
||||
"mfa_disabled": "Multi-factor authentication disabled successfully!",
|
||||
"mfa_page_title": "Multi-factor Authentication",
|
||||
"enable_mfa": "Enable MFA",
|
||||
"disable_mfa": "Disable MFA",
|
||||
"mfa_not_enabled": "MFA is not enabled",
|
||||
"mfa_enabled": "Multi-factor authentication enabled successfully!",
|
||||
"copy": "Copy",
|
||||
"recovery_codes": "Recovery Codes",
|
||||
"recovery_codes_desc": "These are your recovery codes. Keep them safe. You will not be able to see them again.",
|
||||
"reset_session_error": "Please logout and back in to refresh your session and try again.",
|
||||
"authenticator_code": "Authenticator Code",
|
||||
"email_verified": "Email verified successfully!",
|
||||
"email_verified_success": "Your email has been verified. You can now log in.",
|
||||
"email_verified_error": "Error verifying email",
|
||||
"email_verified_erorr_desc": "Your email could not be verified. Please try again.",
|
||||
"invalid_code": "Invalid MFA code",
|
||||
"invalid_credentials": "Invalid username or password",
|
||||
"mfa_required": "Multi-factor authentication is required"
|
||||
},
|
||||
"collection": {
|
||||
"collection_created": "Collection created successfully!",
|
||||
|
|
|
@ -235,7 +235,9 @@
|
|||
"add_a_tag": "Agregar una etiqueta",
|
||||
"tags": "Etiquetas",
|
||||
"set_to_pin": "Establecer en Fijar",
|
||||
"category_fetch_error": "Error al buscar categorías"
|
||||
"category_fetch_error": "Error al buscar categorías",
|
||||
"copied_to_clipboard": "¡Copiado al portapapeles!",
|
||||
"copy_failed": "Copia fallida"
|
||||
},
|
||||
"worldtravel": {
|
||||
"all": "Todo",
|
||||
|
@ -313,7 +315,25 @@
|
|||
"verify": "Verificar",
|
||||
"verify_email_error": "Error al verificar el correo electrónico. \nInténtalo de nuevo en unos minutos.",
|
||||
"verify_email_success": "¡La verificación por correo electrónico se envió correctamente!",
|
||||
"error_change_password": "Error al cambiar la contraseña. \nPor favor verifique su contraseña actual e inténtelo nuevamente."
|
||||
"error_change_password": "Error al cambiar la contraseña. \nPor favor verifique su contraseña actual e inténtelo nuevamente.",
|
||||
"disable_mfa": "Deshabilitar MFA",
|
||||
"enable_mfa": "Habilitar MFA",
|
||||
"mfa_disabled": "¡La autenticación multifactor se deshabilitó correctamente!",
|
||||
"mfa_not_enabled": "MFA no está habilitado",
|
||||
"mfa_page_title": "Autenticación multifactor",
|
||||
"copy": "Copiar",
|
||||
"mfa_enabled": "¡La autenticación multifactor se habilitó correctamente!",
|
||||
"recovery_codes": "Códigos de recuperación",
|
||||
"recovery_codes_desc": "Estos son tus códigos de recuperación. \nMantenlos a salvo. \nNo podrás volver a verlos.",
|
||||
"reset_session_error": "Por favor cierre sesión y vuelva a iniciarla para actualizar su sesión e inténtelo nuevamente.",
|
||||
"authenticator_code": "Código de autenticación",
|
||||
"email_verified": "¡Correo electrónico verificado exitosamente!",
|
||||
"email_verified_erorr_desc": "Su correo electrónico no pudo ser verificado. \nPor favor inténtalo de nuevo.",
|
||||
"email_verified_error": "Error al verificar el correo electrónico",
|
||||
"email_verified_success": "Su correo electrónico ha sido verificado. \nAhora puedes iniciar sesión.",
|
||||
"invalid_code": "Código MFA no válido",
|
||||
"invalid_credentials": "Nombre de usuario o contraseña no válidos",
|
||||
"mfa_required": "Se requiere autenticación multifactor"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Agregar artículo",
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "Ajouter une balise",
|
||||
"tags": "Balises",
|
||||
"set_to_pin": "Définir sur Épingler",
|
||||
"category_fetch_error": "Erreur lors de la récupération des catégories"
|
||||
"category_fetch_error": "Erreur lors de la récupération des catégories",
|
||||
"copied_to_clipboard": "Copié dans le presse-papier !",
|
||||
"copy_failed": "Échec de la copie"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Découvrez, planifiez et explorez en toute simplicité",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "Mes balises",
|
||||
"tag": "Étiqueter",
|
||||
"language_selection": "Langue",
|
||||
"support": "Soutien"
|
||||
"support": "Soutien",
|
||||
"calendar": "Calendrier"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Confirmez le mot de passe",
|
||||
|
@ -250,7 +253,8 @@
|
|||
"username": "Nom d'utilisateur",
|
||||
"profile_picture": "Photo de profil",
|
||||
"public_profile": "Profil public",
|
||||
"public_tooltip": "Avec un profil public, les utilisateurs peuvent partager des collections avec vous et afficher votre profil sur la page des utilisateurs."
|
||||
"public_tooltip": "Avec un profil public, les utilisateurs peuvent partager des collections avec vous et afficher votre profil sur la page des utilisateurs.",
|
||||
"email_required": "L'e-mail est requis"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Aucun utilisateur trouvé avec des profils publics."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "Photo par",
|
||||
"change_password_error": "Impossible de changer le mot de passe. \nMot de passe actuel invalide ou nouveau mot de passe invalide.",
|
||||
"current_password": "Mot de passe actuel",
|
||||
"password_change_lopout_warning": "Vous serez déconnecté après avoir modifié votre mot de passe."
|
||||
"password_change_lopout_warning": "Vous serez déconnecté après avoir modifié votre mot de passe.",
|
||||
"authenticator_code": "Code d'authentification",
|
||||
"copy": "Copie",
|
||||
"disable_mfa": "Désactiver MFA",
|
||||
"email_added": "E-mail ajouté avec succès !",
|
||||
"email_added_error": "Erreur lors de l'ajout de l'e-mail",
|
||||
"email_removed": "E-mail supprimé avec succès !",
|
||||
"email_removed_error": "Erreur lors de la suppression de l'e-mail",
|
||||
"email_set_primary": "E-mail défini comme principal avec succès !",
|
||||
"email_set_primary_error": "Erreur lors de la définition de l'adresse e-mail comme adresse principale",
|
||||
"email_verified": "E-mail vérifié avec succès !",
|
||||
"email_verified_erorr_desc": "Votre email n'a pas pu être vérifié. \nVeuillez réessayer.",
|
||||
"email_verified_error": "Erreur lors de la vérification de l'e-mail",
|
||||
"email_verified_success": "Votre email a été vérifié. \nVous pouvez maintenant vous connecter.",
|
||||
"enable_mfa": "Activer l'authentification multifacteur",
|
||||
"error_change_password": "Erreur lors du changement de mot de passe. \nVeuillez vérifier votre mot de passe actuel et réessayer.",
|
||||
"generic_error": "Une erreur s'est produite lors du traitement de votre demande.",
|
||||
"invalid_code": "Code MFA invalide",
|
||||
"invalid_credentials": "Nom d'utilisateur ou mot de passe invalide",
|
||||
"make_primary": "Rendre primaire",
|
||||
"mfa_disabled": "Authentification multifacteur désactivée avec succès !",
|
||||
"mfa_enabled": "Authentification multifacteur activée avec succès !",
|
||||
"mfa_not_enabled": "MFA n'est pas activé",
|
||||
"mfa_page_title": "Authentification multifacteur",
|
||||
"mfa_required": "Une authentification multifacteur est requise",
|
||||
"no_emai_set": "Aucune adresse e-mail définie",
|
||||
"not_verified": "Non vérifié",
|
||||
"primary": "Primaire",
|
||||
"recovery_codes": "Codes de récupération",
|
||||
"recovery_codes_desc": "Ce sont vos codes de récupération. \nGardez-les en sécurité. \nVous ne pourrez plus les revoir.",
|
||||
"reset_session_error": "Veuillez vous déconnecter, puis vous reconnecter pour actualiser votre session et réessayer.",
|
||||
"verified": "Vérifié",
|
||||
"verify": "Vérifier",
|
||||
"verify_email_error": "Erreur lors de la vérification de l'e-mail. \nRéessayez dans quelques minutes.",
|
||||
"verify_email_success": "Vérification par e-mail envoyée avec succès !"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Ajouter un article",
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "Aggiungi un'etichetta",
|
||||
"tags": "Tag",
|
||||
"set_to_pin": "Imposta su Blocca",
|
||||
"category_fetch_error": "Errore durante il recupero delle categorie"
|
||||
"category_fetch_error": "Errore durante il recupero delle categorie",
|
||||
"copied_to_clipboard": "Copiato negli appunti!",
|
||||
"copy_failed": "Copia non riuscita"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Scopri, pianifica ed esplora con facilità",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "I miei tag",
|
||||
"tag": "Etichetta",
|
||||
"language_selection": "Lingua",
|
||||
"support": "Supporto"
|
||||
"support": "Supporto",
|
||||
"calendar": "Calendario"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Conferma password",
|
||||
|
@ -250,7 +253,8 @@
|
|||
"username": "Nome utente",
|
||||
"profile_picture": "Immagine del profilo",
|
||||
"public_profile": "Profilo pubblico",
|
||||
"public_tooltip": "Con un profilo pubblico, gli utenti possono condividere raccolte con te e visualizzare il tuo profilo nella pagina degli utenti."
|
||||
"public_tooltip": "Con un profilo pubblico, gli utenti possono condividere raccolte con te e visualizzare il tuo profilo nella pagina degli utenti.",
|
||||
"email_required": "L'e-mail è obbligatoria"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Nessun utente trovato con profili pubblici."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "Foto di",
|
||||
"change_password_error": "Impossibile modificare la password. \nPassword attuale non valida o nuova password non valida.",
|
||||
"current_password": "password attuale",
|
||||
"password_change_lopout_warning": "Verrai disconnesso dopo aver modificato la password."
|
||||
"password_change_lopout_warning": "Verrai disconnesso dopo aver modificato la password.",
|
||||
"authenticator_code": "Codice Autenticatore",
|
||||
"copy": "Copia",
|
||||
"disable_mfa": "Disabilita MFA",
|
||||
"email_added": "Email aggiunta con successo!",
|
||||
"email_added_error": "Errore durante l'aggiunta dell'e-mail",
|
||||
"email_removed": "Email rimossa con successo!",
|
||||
"email_removed_error": "Errore durante la rimozione dell'e-mail",
|
||||
"email_set_primary": "Email impostata come primaria con successo!",
|
||||
"email_set_primary_error": "Errore durante l'impostazione dell'e-mail come principale",
|
||||
"email_verified": "Email verificata con successo!",
|
||||
"email_verified_erorr_desc": "Non è stato possibile verificare la tua email. \nPer favore riprova.",
|
||||
"email_verified_error": "Errore durante la verifica dell'e-mail",
|
||||
"email_verified_success": "La tua email è stata verificata. \nOra puoi accedere.",
|
||||
"enable_mfa": "Abilita MFA",
|
||||
"error_change_password": "Errore durante la modifica della password. \nControlla la tua password attuale e riprova.",
|
||||
"generic_error": "Si è verificato un errore durante l'elaborazione della tua richiesta.",
|
||||
"invalid_code": "Codice MFA non valido",
|
||||
"invalid_credentials": "Nome utente o password non validi",
|
||||
"make_primary": "Rendi primario",
|
||||
"mfa_disabled": "Autenticazione a più fattori disabilitata correttamente!",
|
||||
"mfa_enabled": "Autenticazione a più fattori abilitata correttamente!",
|
||||
"mfa_not_enabled": "L'MFA non è abilitata",
|
||||
"mfa_page_title": "Autenticazione a più fattori",
|
||||
"mfa_required": "È richiesta l'autenticazione a più fattori",
|
||||
"no_emai_set": "Nessuna e-mail impostata",
|
||||
"not_verified": "Non verificato",
|
||||
"primary": "Primario",
|
||||
"recovery_codes": "Codici di ripristino",
|
||||
"recovery_codes_desc": "Questi sono i tuoi codici di ripristino. \nTeneteli al sicuro. \nNon potrai vederli più.",
|
||||
"reset_session_error": "Esci, effettua nuovamente l'accesso per aggiornare la sessione e riprova.",
|
||||
"verified": "Verificato",
|
||||
"verify_email_success": "Verifica email inviata con successo!",
|
||||
"verify": "Verificare",
|
||||
"verify_email_error": "Errore durante la verifica dell'e-mail. \nRiprova tra qualche minuto."
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Aggiungi articolo",
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "Voeg een label toe",
|
||||
"tags": "Labels",
|
||||
"set_to_pin": "Stel in op pin",
|
||||
"category_fetch_error": "Fout bij ophalen van categorieën"
|
||||
"category_fetch_error": "Fout bij ophalen van categorieën",
|
||||
"copied_to_clipboard": "Gekopieerd naar klembord!",
|
||||
"copy_failed": "Kopiëren mislukt"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Ontdek, plan en verken met gemak",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "Mijn labels",
|
||||
"tag": "Label",
|
||||
"language_selection": "Taal",
|
||||
"support": "Steun"
|
||||
"support": "Steun",
|
||||
"calendar": "Kalender"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Bevestig wachtwoord",
|
||||
|
@ -250,7 +253,8 @@
|
|||
"username": "Gebruikersnaam",
|
||||
"profile_picture": "Profielfoto",
|
||||
"public_profile": "Openbaar profiel",
|
||||
"public_tooltip": "Met een openbaar profiel kunnen gebruikers collecties met u delen en uw profiel bekijken op de gebruikerspagina."
|
||||
"public_tooltip": "Met een openbaar profiel kunnen gebruikers collecties met u delen en uw profiel bekijken op de gebruikerspagina.",
|
||||
"email_required": "E-mail is vereist"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Er zijn geen gebruikers gevonden met openbare profielen."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "Foto door",
|
||||
"change_password_error": "Kan wachtwoord niet wijzigen. \nOngeldig huidig wachtwoord of ongeldig nieuw wachtwoord.",
|
||||
"current_password": "Huidig wachtwoord",
|
||||
"password_change_lopout_warning": "Na het wijzigen van uw wachtwoord wordt u uitgelogd."
|
||||
"password_change_lopout_warning": "Na het wijzigen van uw wachtwoord wordt u uitgelogd.",
|
||||
"authenticator_code": "Authenticatiecode",
|
||||
"copy": "Kopiëren",
|
||||
"disable_mfa": "Schakel MFA uit",
|
||||
"email_added": "E-mailadres succesvol toegevoegd!",
|
||||
"email_added_error": "Fout bij het toevoegen van e-mailadres",
|
||||
"email_removed": "E-mail succesvol verwijderd!",
|
||||
"email_removed_error": "Fout bij verwijderen van e-mail",
|
||||
"email_set_primary": "E-mailadres is succesvol ingesteld als primair!",
|
||||
"email_set_primary_error": "Fout bij het instellen van e-mail als primair",
|
||||
"email_verified": "E-mail succesvol geverifieerd!",
|
||||
"email_verified_erorr_desc": "Uw e-mailadres kan niet worden geverifieerd. \nProbeer het opnieuw.",
|
||||
"email_verified_error": "Fout bij het verifiëren van e-mailadres",
|
||||
"email_verified_success": "Uw e-mailadres is geverifieerd. \nU kunt nu inloggen.",
|
||||
"enable_mfa": "Schakel MFA in",
|
||||
"error_change_password": "Fout bij wijzigen van wachtwoord. \nControleer uw huidige wachtwoord en probeer het opnieuw.",
|
||||
"generic_error": "Er is een fout opgetreden tijdens het verwerken van uw verzoek.",
|
||||
"invalid_code": "Ongeldige MFA-code",
|
||||
"invalid_credentials": "Ongeldige gebruikersnaam of wachtwoord",
|
||||
"make_primary": "Maak primair",
|
||||
"mfa_disabled": "Multi-factor authenticatie is succesvol uitgeschakeld!",
|
||||
"mfa_enabled": "Multi-factor authenticatie succesvol ingeschakeld!",
|
||||
"mfa_not_enabled": "MFA is niet ingeschakeld",
|
||||
"mfa_page_title": "Authenticatie met meerdere factoren",
|
||||
"mfa_required": "Multi-factor authenticatie is vereist",
|
||||
"no_emai_set": "Geen e-mailadres ingesteld",
|
||||
"not_verified": "Niet geverifieerd",
|
||||
"primary": "Primair",
|
||||
"recovery_codes": "Herstelcodes",
|
||||
"recovery_codes_desc": "Dit zijn uw herstelcodes. \nBewaar ze veilig. \nJe zult ze niet meer kunnen zien.",
|
||||
"reset_session_error": "Meld u af en weer aan om uw sessie te vernieuwen en het opnieuw te proberen.",
|
||||
"verified": "Geverifieerd",
|
||||
"verify": "Verifiëren",
|
||||
"verify_email_error": "Fout bij het verifiëren van e-mailadres. \nProbeer het over een paar minuten opnieuw.",
|
||||
"verify_email_success": "E-mailverificatie succesvol verzonden!"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Artikel toevoegen",
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
"aestheticDark": "Estetyczny Ciemny",
|
||||
"aqua": "Aqua",
|
||||
"northernLights": "Zorza Polarna"
|
||||
}
|
||||
},
|
||||
"calendar": "Kalendarz"
|
||||
},
|
||||
"about": {
|
||||
"about": "O aplikacji",
|
||||
|
@ -234,7 +235,9 @@
|
|||
"spiritual_journeys": "Podróże duchowe 🧘♀️",
|
||||
"volunteer_work": "Praca wolontariacka 🤝",
|
||||
"other": "Inne"
|
||||
}
|
||||
},
|
||||
"copied_to_clipboard": "Skopiowano do schowka!",
|
||||
"copy_failed": "Kopiowanie nie powiodło się"
|
||||
},
|
||||
"worldtravel": {
|
||||
"country_list": "Lista krajów",
|
||||
|
@ -261,7 +264,8 @@
|
|||
"registration_disabled": "Rejestracja jest obecnie wyłączona.",
|
||||
"profile_picture": "Zdjęcie profilowe",
|
||||
"public_profile": "Publiczny profil",
|
||||
"public_tooltip": "Dzięki publicznemu profilowi użytkownicy mogą dzielić się z Tobą kolekcjami i oglądać Twój profil na stronie użytkowników."
|
||||
"public_tooltip": "Dzięki publicznemu profilowi użytkownicy mogą dzielić się z Tobą kolekcjami i oglądać Twój profil na stronie użytkowników.",
|
||||
"email_required": "Adres e-mail jest wymagany"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Nie znaleziono użytkowników z publicznymi profilami."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"join_discord_desc": "aby podzielić się swoimi zdjęciami. Zamieść je w kanale #travel-share.",
|
||||
"change_password_error": "Nie można zmienić hasła. \nNieprawidłowe bieżące hasło lub nieprawidłowe nowe hasło.",
|
||||
"current_password": "Aktualne hasło",
|
||||
"password_change_lopout_warning": "Po zmianie hasła nastąpi wylogowanie."
|
||||
"password_change_lopout_warning": "Po zmianie hasła nastąpi wylogowanie.",
|
||||
"authenticator_code": "Kod uwierzytelniający",
|
||||
"copy": "Kopia",
|
||||
"disable_mfa": "Wyłącz usługę MFA",
|
||||
"email_added": "Adres e-mail został pomyślnie dodany!",
|
||||
"email_added_error": "Błąd podczas dodawania adresu e-mail",
|
||||
"email_removed": "E-mail został pomyślnie usunięty!",
|
||||
"email_removed_error": "Błąd podczas usuwania wiadomości e-mail",
|
||||
"email_set_primary": "Adres e-mail został pomyślnie ustawiony jako podstawowy!",
|
||||
"email_set_primary_error": "Błąd podczas ustawiania adresu e-mail jako głównego",
|
||||
"email_verified": "E-mail zweryfikowany pomyślnie!",
|
||||
"email_verified_erorr_desc": "Nie udało się zweryfikować Twojego adresu e-mail. \nSpróbuj ponownie.",
|
||||
"email_verified_error": "Błąd podczas weryfikacji adresu e-mail",
|
||||
"email_verified_success": "Twój e-mail został zweryfikowany. \nMożesz się teraz zalogować.",
|
||||
"enable_mfa": "Włącz usługę MFA",
|
||||
"error_change_password": "Błąd podczas zmiany hasła. \nSprawdź swoje aktualne hasło i spróbuj ponownie.",
|
||||
"generic_error": "Wystąpił błąd podczas przetwarzania Twojego żądania.",
|
||||
"invalid_code": "Nieprawidłowy kod MFA",
|
||||
"invalid_credentials": "Nieprawidłowa nazwa użytkownika lub hasło",
|
||||
"make_primary": "Ustaw jako podstawowy",
|
||||
"mfa_disabled": "Uwierzytelnianie wieloskładnikowe zostało pomyślnie wyłączone!",
|
||||
"mfa_enabled": "Uwierzytelnianie wieloskładnikowe zostało pomyślnie włączone!",
|
||||
"mfa_not_enabled": "Usługa MFA nie jest włączona",
|
||||
"mfa_page_title": "Uwierzytelnianie wieloskładnikowe",
|
||||
"mfa_required": "Wymagane jest uwierzytelnianie wieloskładnikowe",
|
||||
"no_emai_set": "Nie ustawiono adresu e-mail",
|
||||
"not_verified": "Nie zweryfikowano",
|
||||
"primary": "Podstawowy",
|
||||
"recovery_codes": "Kody odzyskiwania",
|
||||
"recovery_codes_desc": "To są Twoje kody odzyskiwania. \nZapewnij im bezpieczeństwo. \nNie będziesz mógł ich ponownie zobaczyć.",
|
||||
"reset_session_error": "Wyloguj się i zaloguj ponownie, aby odświeżyć sesję i spróbuj ponownie.",
|
||||
"verified": "Zweryfikowano",
|
||||
"verify": "Zweryfikować",
|
||||
"verify_email_error": "Błąd podczas weryfikacji adresu e-mail. \nSpróbuj ponownie za kilka minut.",
|
||||
"verify_email_success": "Weryfikacja e-mailowa została wysłana pomyślnie!"
|
||||
},
|
||||
"collection": {
|
||||
"collection_created": "Kolekcja została pomyślnie utworzona!",
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "Lägg till en tagg",
|
||||
"tags": "Taggar",
|
||||
"set_to_pin": "Ställ in på Pin",
|
||||
"category_fetch_error": "Det gick inte att hämta kategorier"
|
||||
"category_fetch_error": "Det gick inte att hämta kategorier",
|
||||
"copied_to_clipboard": "Kopierat till urklipp!",
|
||||
"copy_failed": "Kopieringen misslyckades"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Upptäck, planera och utforska med lätthet",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "Mina taggar",
|
||||
"tag": "Märka",
|
||||
"language_selection": "Språk",
|
||||
"support": "Stöd"
|
||||
"support": "Stöd",
|
||||
"calendar": "Kalender"
|
||||
},
|
||||
"worldtravel": {
|
||||
"all": "Alla",
|
||||
|
@ -261,7 +264,8 @@
|
|||
"username": "Användarnamn",
|
||||
"public_tooltip": "Med en offentlig profil kan användare dela samlingar med dig och se din profil på användarsidan.",
|
||||
"profile_picture": "Profilbild",
|
||||
"public_profile": "Offentlig profil"
|
||||
"public_profile": "Offentlig profil",
|
||||
"email_required": "E-post krävs"
|
||||
},
|
||||
"users": {
|
||||
"no_users_found": "Inga användare hittades med offentliga profiler."
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "Foto av",
|
||||
"change_password_error": "Det går inte att ändra lösenord. \nOgiltigt nuvarande lösenord eller ogiltigt nytt lösenord.",
|
||||
"current_password": "Aktuellt lösenord",
|
||||
"password_change_lopout_warning": "Du kommer att loggas ut efter att du har ändrat ditt lösenord."
|
||||
"password_change_lopout_warning": "Du kommer att loggas ut efter att du har ändrat ditt lösenord.",
|
||||
"authenticator_code": "Autentiseringskod",
|
||||
"copy": "Kopiera",
|
||||
"disable_mfa": "Inaktivera MFA",
|
||||
"email_added": "E-post har lagts till!",
|
||||
"email_added_error": "Det gick inte att lägga till e-post",
|
||||
"email_removed": "E-post har tagits bort!",
|
||||
"email_removed_error": "Det gick inte att ta bort e-post",
|
||||
"email_set_primary": "E-post har angetts som primärt!",
|
||||
"email_set_primary_error": "Det gick inte att ställa in e-post som primär",
|
||||
"email_verified": "E-post har verifierats!",
|
||||
"email_verified_erorr_desc": "Din e-postadress kunde inte verifieras. \nFörsök igen.",
|
||||
"email_verified_error": "Fel vid verifiering av e-post",
|
||||
"email_verified_success": "Din e-postadress har verifierats. \nDu kan nu logga in.",
|
||||
"enable_mfa": "Aktivera MFA",
|
||||
"error_change_password": "Fel vid byte av lösenord. \nKontrollera ditt nuvarande lösenord och försök igen.",
|
||||
"generic_error": "Ett fel uppstod när din begäran bearbetades.",
|
||||
"invalid_code": "Ogiltig MFA-kod",
|
||||
"invalid_credentials": "Ogiltigt användarnamn eller lösenord",
|
||||
"make_primary": "Gör Primär",
|
||||
"mfa_disabled": "Multifaktorautentisering har inaktiverats!",
|
||||
"mfa_enabled": "Multifaktorautentisering har aktiverats!",
|
||||
"mfa_not_enabled": "MFA är inte aktiverat",
|
||||
"mfa_page_title": "Multifaktorautentisering",
|
||||
"mfa_required": "Flerfaktorsautentisering krävs",
|
||||
"no_emai_set": "Ingen e-post inställd",
|
||||
"not_verified": "Ej verifierad",
|
||||
"primary": "Primär",
|
||||
"recovery_codes": "Återställningskoder",
|
||||
"recovery_codes_desc": "Det här är dina återställningskoder. \nHåll dem säkra. \nDu kommer inte att kunna se dem igen.",
|
||||
"reset_session_error": "Logga ut och in igen för att uppdatera din session och försök igen.",
|
||||
"verified": "Verifierad",
|
||||
"verify": "Kontrollera",
|
||||
"verify_email_error": "Fel vid verifiering av e-post. \nFörsök igen om några minuter.",
|
||||
"verify_email_success": "E-postverifiering har skickats!"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "Lägg till objekt",
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
"add_a_tag": "添加标签",
|
||||
"tags": "标签",
|
||||
"set_to_pin": "设置为固定",
|
||||
"category_fetch_error": "获取类别时出错"
|
||||
"category_fetch_error": "获取类别时出错",
|
||||
"copied_to_clipboard": "已复制到剪贴板!",
|
||||
"copy_failed": "复制失败"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "轻松发现、规划和探索",
|
||||
|
@ -234,7 +236,8 @@
|
|||
"my_tags": "我的标签",
|
||||
"tag": "标签",
|
||||
"language_selection": "语言",
|
||||
"support": "支持"
|
||||
"support": "支持",
|
||||
"calendar": "日历"
|
||||
},
|
||||
"auth": {
|
||||
"forgot_password": "忘记密码?",
|
||||
|
@ -250,7 +253,8 @@
|
|||
"registration_disabled": "目前已禁用注册。",
|
||||
"profile_picture": "个人资料图片",
|
||||
"public_profile": "公开资料",
|
||||
"public_tooltip": "通过公开个人资料,用户可以与您共享收藏并在用户页面上查看您的个人资料。"
|
||||
"public_tooltip": "通过公开个人资料,用户可以与您共享收藏并在用户页面上查看您的个人资料。",
|
||||
"email_required": "电子邮件为必填项"
|
||||
},
|
||||
"worldtravel": {
|
||||
"all": "全部",
|
||||
|
@ -295,7 +299,41 @@
|
|||
"photo_by": "摄影:",
|
||||
"change_password_error": "无法更改密码。\n当前密码无效或新密码无效。",
|
||||
"current_password": "当前密码",
|
||||
"password_change_lopout_warning": "更改密码后您将退出。"
|
||||
"password_change_lopout_warning": "更改密码后您将退出。",
|
||||
"authenticator_code": "验证码",
|
||||
"copy": "复制",
|
||||
"disable_mfa": "禁用 MFA",
|
||||
"email_added": "邮箱添加成功!",
|
||||
"email_added_error": "添加电子邮件时出错",
|
||||
"email_removed": "电子邮件删除成功!",
|
||||
"email_removed_error": "删除电子邮件时出错",
|
||||
"email_set_primary": "成功将电子邮件设置为主!",
|
||||
"email_set_primary_error": "将电子邮件设置为主要电子邮件时出错",
|
||||
"email_verified": "邮箱验证成功!",
|
||||
"email_verified_erorr_desc": "无法验证您的电子邮件。\n请再试一次。",
|
||||
"email_verified_error": "验证电子邮件时出错",
|
||||
"email_verified_success": "您的电子邮件已被验证。\n您现在可以登录了。",
|
||||
"enable_mfa": "启用 MFA",
|
||||
"error_change_password": "更改密码时出错。\n请检查您当前的密码,然后重试。",
|
||||
"generic_error": "处理您的请求时发生错误。",
|
||||
"invalid_code": "MFA 代码无效",
|
||||
"invalid_credentials": "用户名或密码无效",
|
||||
"make_primary": "设为主要",
|
||||
"mfa_disabled": "多重身份验证已成功禁用!",
|
||||
"mfa_enabled": "多重身份验证启用成功!",
|
||||
"mfa_not_enabled": "MFA 未启用",
|
||||
"mfa_page_title": "多重身份验证",
|
||||
"mfa_required": "需要多重身份验证",
|
||||
"no_emai_set": "没有设置电子邮件",
|
||||
"not_verified": "未验证",
|
||||
"primary": "基本的",
|
||||
"recovery_codes": "恢复代码",
|
||||
"recovery_codes_desc": "这些是您的恢复代码。\n确保他们的安全。\n你将无法再见到他们。",
|
||||
"reset_session_error": "请注销并重新登录以刷新您的会话,然后重试。",
|
||||
"verified": "已验证",
|
||||
"verify": "核实",
|
||||
"verify_email_error": "验证电子邮件时出错。\n几分钟后重试。",
|
||||
"verify_email_success": "邮箱验证发送成功!"
|
||||
},
|
||||
"checklist": {
|
||||
"add_item": "添加项目",
|
||||
|
|
|
@ -52,7 +52,7 @@ export const actions: Actions = {
|
|||
// MFA required
|
||||
if (!totp) {
|
||||
return fail(401, {
|
||||
message: 'Multi-factor authentication required',
|
||||
message: 'settings.mfa_required',
|
||||
mfa_required: true
|
||||
});
|
||||
} else {
|
||||
|
@ -80,7 +80,7 @@ export const actions: Actions = {
|
|||
// MFA failed
|
||||
const mfaLoginResponse = await mfaLoginFetch.json();
|
||||
return fail(401, {
|
||||
message: mfaLoginResponse.error || 'Invalid MFA code',
|
||||
message: mfaLoginResponse.error || 'settings.invalid_code',
|
||||
mfa_required: true
|
||||
});
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ export const actions: Actions = {
|
|||
// Login failed
|
||||
const loginResponse = await loginFetch.json();
|
||||
const firstKey = Object.keys(loginResponse)[0] || 'error';
|
||||
const error = loginResponse[firstKey][0] || 'Invalid username or password';
|
||||
const error = loginResponse[firstKey][0] || 'settings.invalid_credentials';
|
||||
return fail(400, { message: error });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
{#if ($page.form?.message && $page.form?.message.length > 1) || $page.form?.type === 'error'}
|
||||
<div class="text-center text-error mt-4">
|
||||
{$page.form.message || $t('auth.login_error')}
|
||||
{$t($page.form.message) || $t('auth.login_error')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
let new_email: string = '';
|
||||
|
||||
let is2FAModalOpen: boolean = false;
|
||||
let isMFAModalOpen: boolean = false;
|
||||
|
||||
onMount(async () => {
|
||||
if (browser) {
|
||||
|
@ -133,21 +133,21 @@
|
|||
method: 'DELETE'
|
||||
});
|
||||
if (res.ok) {
|
||||
addToast('success', '2FA disabled');
|
||||
addToast('success', $t('settings.mfa_disabled'));
|
||||
data.props.authenticators = false;
|
||||
} else {
|
||||
if (res.status == 401) {
|
||||
addToast('error', 'Logout and back in to refresh your session and try again.');
|
||||
addToast('error', $t('settings.reset_session_error'));
|
||||
}
|
||||
addToast('error', $t('settings.generic_error'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if is2FAModalOpen}
|
||||
{#if isMFAModalOpen}
|
||||
<TotpModal
|
||||
user={data.user}
|
||||
on:close={() => (is2FAModalOpen = false)}
|
||||
on:close={() => (isMFAModalOpen = false)}
|
||||
bind:is_enabled={data.props.authenticators}
|
||||
/>
|
||||
{/if}
|
||||
|
@ -306,17 +306,19 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<h1 class="text-center font-extrabold text-xl mt-4 mb-2">Multi-factor Authentication Settings</h1>
|
||||
<h1 class="text-center font-extrabold text-xl mt-4 mb-2">{$t('settings.mfa_page_title')}</h1>
|
||||
|
||||
<div class="flex justify-center mb-4">
|
||||
<div>
|
||||
{#if !data.props.authenticators}
|
||||
<p>MFA not enabled</p>
|
||||
<button class="btn btn-primary mt-2" on:click={() => (is2FAModalOpen = true)}
|
||||
>Enable MFA</button
|
||||
<p>{$t('settings.mfa_not_enabled')}</p>
|
||||
<button class="btn btn-primary mt-2" on:click={() => (isMFAModalOpen = true)}
|
||||
>{$t('settings.enable_mfa')}</button
|
||||
>
|
||||
{:else}
|
||||
<button class="btn btn-warning mt-2" on:click={disableMfa}>Disable MFA</button>
|
||||
<button class="btn btn-warning mt-2" on:click={disableMfa}
|
||||
>{$t('settings.disable_mfa')}</button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from '../$types';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
{#if data.verified}
|
||||
<h1>Email verified</h1>
|
||||
<p>Your email has been verified. You can now log in.</p>
|
||||
<h1>{$t('settings.email_verified')}</h1>
|
||||
<p>{$t('settings.email_verified_success')}</p>
|
||||
{:else}
|
||||
<h1>Email verification failed</h1>
|
||||
<p>Your email could not be verified. Please try again.</p>
|
||||
<h1>{$t('settings.email_verified_error')}</h1>
|
||||
<p>{$t('settings.email_verified_erorr_desc')}</p>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue