From 34c6d2e5283d07e6006438fc3c5b1af5891b52f8 Mon Sep 17 00:00:00 2001 From: MD <1917406+mdcfe@users.noreply.github.com> Date: Sat, 10 Aug 2024 15:17:21 +0100 Subject: [PATCH 1/4] Improve login page strings --- frontend/src/i18n/locales/en.json | 17 +++++++++++++++++ frontend/src/pages/auth/login.vue | 31 +++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index cfbec5a0b..740c44a27 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -939,6 +939,23 @@ } }, "auth": { + "login": { + "main": { + "title": "Log in to Hangar" + }, + "sudo": { + "title": "Verify your identity", + "info": "You need to authenticate again to perform this action." + }, + "twoFactor": { + "title": "Two-factor authentication", + "info": "Your account uses two-factor authentication. Use one of your saved methods to continue.", + "webauthn": { + "button": "Use passkey", + "genericError": "Passkey authentication failed. Try again, or use another method." + } + } + }, "settings": { "profile": { "header": "Profile", diff --git a/frontend/src/pages/auth/login.vue b/frontend/src/pages/auth/login.vue index e6bed88c2..926ddc65a 100644 --- a/frontend/src/pages/auth/login.vue +++ b/frontend/src/pages/auth/login.vue @@ -30,6 +30,26 @@ if (privileged) { loading.value = false; } +const dialogTitle = computed(() => { + if (privileged) { + return i18n.t("auth.login.sudo.title"); + } + if (supportedMethods.value.length > 0) { + return i18n.t("auth.login.twoFactor.title"); + } + return i18n.t("auth.login.main.title"); +}) + +const dialogInfo = computed(() => { + if (privileged) { + return i18n.t("auth.login.sudo.info"); + } + if (supportedMethods.value.length > 0) { + return i18n.t("auth.login.twoFactor.info"); + } + return null; +}) + async function loginPassword() { if (!(await v.value.$validate())) return; loading.value = true; @@ -125,9 +145,9 @@ useHead(useSeo("Login", null, route, null)); From e4696a55830d1554db56498cd863183c9d9de7b5 Mon Sep 17 00:00:00 2001 From: MD <1917406+mdcfe@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:08:04 +0100 Subject: [PATCH 3/4] More security page layout/strings improvements --- frontend/src/i18n/locales/en.json | 6 +++--- frontend/src/pages/auth/settings/security.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 7518bd7b1..7ea0ab3de 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -1007,9 +1007,9 @@ "info": "If you lose access to your other two-factor methods, you can use a backup code to log in.", "generateNew": "Generate new codes", "modal": { - "title": "Confirm backup codes", - "needConfigure": "You need to configure backup codes before you can activate 2fa. Please save these codes securely!", - "confirm": "Confirm that you saved the backup codes by entering one of them below", + "title": "Save your backup codes", + "needConfigure": "If you ever lose access to your main two-factor authentication methods, you can use these backup codes once to log in.", + "confirm": "Store these backup codes somewhere. To finish setting up two-factor authentication, confirm that you saved the backup codes by entering one of them below:", "backupCode": "Backup Code" } }, diff --git a/frontend/src/pages/auth/settings/security.vue b/frontend/src/pages/auth/settings/security.vue index 210f32af8..7f79ef292 100644 --- a/frontend/src/pages/auth/settings/security.vue +++ b/frontend/src/pages/auth/settings/security.vue @@ -281,7 +281,7 @@ function closeUnlinkModal() {
- totp qr code + QR code for TOTP setup {{ totpData.secret }}
@@ -328,7 +328,7 @@ function closeUnlinkModal() {