From e3fb871e4fb52ac0387e10a225e52286efc78ed8 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Sat, 22 Mar 2025 15:55:14 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Reformat=20MFA=20option?= =?UTF-8?q?=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../options/multi_factor_authentication.ts | 98 +++++++++++-------- src/public/translations/en/translation.json | 16 +++ 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/multi_factor_authentication.ts b/src/public/app/widgets/type_widgets/options/multi_factor_authentication.ts index 7df18c301..413784119 100644 --- a/src/public/app/widgets/type_widgets/options/multi_factor_authentication.ts +++ b/src/public/app/widgets/type_widgets/options/multi_factor_authentication.ts @@ -2,65 +2,75 @@ import server from "../../../services/server.js"; import toastService from "../../../services/toast.js"; import OptionsWidget from "./options_widget.js"; import type { OptionMap } from "../../../../../services/options_interface.js"; +import { t } from "../../../services/i18n.js"; const TPL = `
-

What is Multi-Factor Authentication?

- - Multi-Factor Authentication (MFA) adds an extra layer of security to your account. Instead - of just entering a password to log in, MFA requires you to provide one or more additional - pieces of evidence to verify your identity. This way, even if someone gets hold of your - password, they still can't access your account without the second piece of information. - It's like adding an extra lock to your door, making it much harder for anyone else to - break in. +

${t("multi_factor_authentication.title")}

+

${t("multi_factor_authentication.description")}

-

OAuth/OpenID

- OpenID is a standardized way to let you log into websites using an account from another service, like Google, to verify your identity. -
- - - +

${t("multi_factor_authentication.oauth_title")}

+ +
+
+ +
-
- User Account: + + + +
+ User Account:
- User Email: + User Email:
+ +

${t("multi_factor_authentication.oauth_description")}

-

Time-based One-Time Password

-
- - - -
-
- TOTP (Time-Based One-Time Password) is a security feature that generates a unique, temporary - code which changes every 30 seconds. You use this code, along with your password to log into your - account, making it much harder for anyone else to access it. +

${t("multi_factor_authentication.totp_title")}

+ +
+
+ +
+ + + +

${t("multi_factor_authentication.totp_description")}

-

Generate TOTP Secret

- TOTP Secret Key +

${t("multi_factor_authentication.totp_secret_title")}

+ +
+
${t("multi_factor_authentication.totp_secret_description")}
+
+ + +
+ +
+

${t("multi_factor_authentication.recovery_keys_title")}

+ +

${t("multi_factor_authentication.recovery_keys_description")}

+ + +
- -
-
-

Single Sign-on Recovery Keys

- Single sign-on recovery keys are used to login in the event you cannot access your Authenticator codes. Keep them somewhere safe and secure. -

- After a recovery key is used it cannot be used again. -

@@ -85,8 +95,10 @@ const TPL = `
+
- + +
`; @@ -199,7 +211,7 @@ export default class MultiFactorAuthenticationOptions extends OptionsWidget { if (result.email) this.$UserAccountEmail.text(result.email); } else { this.$envEnabledOAuth.text( - "set SSO_ENABLED as environment variable to 'true' to enable (Requires restart)" + "Set SSO_ENABLED as environment variable to 'true' to enable (Requires restart)" ); } }); diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 46bf2ed4d..40ce5a0ef 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1309,6 +1309,22 @@ "password_mismatch": "New passwords are not the same.", "password_changed_success": "Password has been changed. Trilium will be reloaded after you press OK." }, + "multi_factor_authentication": { + "title": "Multi-Factor Authentication", + "description": "Multi-Factor Authentication (MFA) adds an extra layer of security to your account. Instead of just entering a password to log in, MFA requires you to provide one or more additional pieces of evidence to verify your identity. This way, even if someone gets hold of your password, they still can't access your account without the second piece of information. It's like adding an extra lock to your door, making it much harder for anyone else to break in.", + "oauth_title": "OAuth/OpenID", + "oauth_enabled": "OAuth/OpenID Enabled", + "oauth_description": "OpenID is a standardized way to let you log into websites using an account from another service, like Google, to verify your identity.", + "totp_title": "Time-based One-Time Password", + "totp_enabled": "TOTP Enabled", + "totp_description": "TOTP (Time-Based One-Time Password) is a security feature that generates a unique, temporary code which changes every 30 seconds. You use this code, along with your password to log into your account, making it much harder for anyone else to access it.", + "totp_secret_title": "Generate TOTP Secret", + "totp_secret_description": "TOTP Secret Key", + "totp_secret_generate": "Generate TOTP Secret", + "recovery_keys_title": "Single Sign-on Recovery Keys", + "recovery_keys_description": "Single sign-on recovery keys are used to login in the event you cannot access your Authenticator codes. Keep them somewhere safe and secure.", + "recovery_keys_description_warning": "After a recovery key is used it cannot be used again." + }, "shortcuts": { "keyboard_shortcuts": "Keyboard Shortcuts", "multiple_shortcuts": "Multiple shortcuts for the same action can be separated by comma.",