Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix(2FA): add missing translations

Rudy B.c127767c8386
diff --git a/public/intl/messages/en-US.json b/public/intl/messages/en-US.json
index 6c5aa6bf6..670cd3242 100644
--- a/public/intl/messages/en-US.json
+++ b/public/intl/messages/en-US.json
@@ -483,6 +483,7 @@
"two-factor-error-disable-not-allowed": "Two-factor authentication is required and cannot be disabled.",
"two-factor-error-incorrect-password": "Incorrect password.",
"two-factor-error-not-enabled": "Two-factor authentication is not enabled.",
+ "two-factor-error-no-pending-setup": "No pending two-factor authentication setup found.",
"two-factor-locked-message": "Too many failed attempts. Try again at {time}.",
"two-factor-active-description": "Your account is protected with two-factor authentication. Each login requires a code from your authenticator app."
}
diff --git a/public/intl/messages/fr-FR.json b/public/intl/messages/fr-FR.json
index b8d8410c5..51fadc00c 100644
--- a/public/intl/messages/fr-FR.json
+++ b/public/intl/messages/fr-FR.json
@@ -481,6 +481,7 @@
"two-factor-error-disable-not-allowed": "L’authentification à deux facteurs est obligatoire et ne peut pas être désactivée.",
"two-factor-error-incorrect-password": "Mot de passe incorrect.",
"two-factor-error-not-enabled": "L’authentification à deux facteurs n’est pas activée.",
+ "two-factor-error-no-pending-setup": "Aucune configuration d’authentification à deux facteurs en attente n’a été trouvée.",
"two-factor-locked-message": "Trop de tentatives infructueuses. Réessayez à {time}.",
"two-factor-active-description": "Votre compte est protégé par l’authentification à deux facteurs. Chaque connexion nécessite un code provenant de votre application d’authentification."
}
diff --git a/src/app/api/2fa/setup/confirm/route.ts b/src/app/api/2fa/setup/confirm/route.ts
index 2d03e2fa1..f693e5b59 100644
--- a/src/app/api/2fa/setup/confirm/route.ts
+++ b/src/app/api/2fa/setup/confirm/route.ts
@@ -24,7 +24,10 @@ export async function POST(request: Request) {
// Verify if 2FA is waiting for setup
if (!twoFactor || twoFactor.isEnabled) {
- return badRequest({ message: 'No pending 2FA setup found' });
+ return badRequest({
+ code: 'two-factor-error-no-pending-setup',
+ message: 'No pending 2FA setup found',
+ });
}
// Verify rate limit
diff --git a/src/components/messages.ts b/src/components/messages.ts
index 8809d0310..3191a56ce 100644
--- a/src/components/messages.ts
+++ b/src/components/messages.ts
@@ -476,4 +476,14 @@ export const messages: Record<string, string> = {
twoFactorUserDescription: 'message.two-factor-user-description',
twoFactorLockedMessage: 'message.two-factor-locked-message',
twoFactorActiveDescription: 'message.two-factor-active-description',
+ twoFactorErrorInvalidCode: 'message.two-factor-error-invalid-code',
+ twoFactorErrorMissingToken: 'message.two-factor-error-missing-token',
+ twoFactorErrorInvalidPartialToken: 'message.two-factor-error-invalid-partial-token',
+ twoFactorErrorInvalidBackupCode: 'message.two-factor-error-invalid-backup-code',
+ twoFactorErrorCodeUsed: 'message.two-factor-error-code-used',
+ twoFactorErrorTooManyAttempts: 'message.two-factor-error-too-many-attempts',
+ twoFactorErrorDisableNotAllowed: 'message.two-factor-error-disable-not-allowed',
+ twoFactorErrorIncorrectPassword: 'message.two-factor-error-incorrect-password',
+ twoFactorErrorNotEnabled: 'message.two-factor-error-not-enabled',
+ twoFactorErrorNoPendingSetup: 'message.two-factor-error-no-pending-setup',
};