From cb3627ed50f283408a7e6fea1cb279ab62e1f0bb Mon Sep 17 00:00:00 2001
From: Jin <22962980+JYC333@users.noreply.github.com>
Date: Fri, 28 Mar 2025 12:01:18 +0100
Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20better=20totp=20instruc?=
=?UTF-8?q?tion?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../options/multi_factor_authentication.ts | 15 ++++++++++++---
src/public/translations/cn/translation.json | 7 ++++---
src/public/translations/en/translation.json | 11 ++++++-----
3 files changed, 22 insertions(+), 11 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 927a9209a..e7ea2b269 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
@@ -40,6 +40,10 @@ const TPL_WEB = `
${t("multi_factor_authentication.totp_secret_title")}
+
+ ${t("multi_factor_authentication.no_totp_secret_warning")}
+
+
${t("multi_factor_authentication.totp_secret_description_warning")}
@@ -92,15 +96,15 @@ const TPL_WEB = `
${t("multi_factor_authentication.oauth_description")}
-
+
${t("multi_factor_authentication.oauth_description_warning")}
- ${t("multi_factor_authentication.oauth_user_account")} ${t("multi_factor_authentication.oauth_user_not_logged_in")}
+ ${t("multi_factor_authentication.oauth_user_account")}${t("multi_factor_authentication.oauth_user_not_logged_in")}
- ${t("multi_factor_authentication.oauth_user_email")} ${t("multi_factor_authentication.oauth_user_not_logged_in")}
+ ${t("multi_factor_authentication.oauth_user_email")}${t("multi_factor_authentication.oauth_user_not_logged_in")}
@@ -137,6 +141,7 @@ export default class MultiFactorAuthenticationOptions extends OptionsWidget {
private $mfaOptions!: JQuery;
private $mfaMethodRadios!: JQuery;
private $totpOptions!: JQuery;
+ private $noTotpSecretWarning!: JQuery;
private $generateTotpButton!: JQuery;
private $generateRecoveryCodeButton!: JQuery;
private $recoveryKeys: JQuery[] = [];
@@ -154,6 +159,7 @@ export default class MultiFactorAuthenticationOptions extends OptionsWidget {
this.$mfaOptions = this.$widget.find(".mfa-options");
this.$mfaMethodRadios = this.$widget.find(".mfa-method-radio");
this.$totpOptions = this.$widget.find(".totp-options");
+ this.$noTotpSecretWarning = this.$widget.find(".no-totp-secret");
this.$generateTotpButton = this.$widget.find(".generate-totp");
this.$generateRecoveryCodeButton = this.$widget.find(".generate-recovery-code");
@@ -321,6 +327,9 @@ export default class MultiFactorAuthenticationOptions extends OptionsWidget {
server.get("totp/status").then((result) => {
if (result.set) {
this.$generateTotpButton.text(t("multi_factor_authentication.totp_secret_regenerate"));
+ this.$noTotpSecretWarning.hide();
+ } else {
+ this.$noTotpSecretWarning.show();
}
});
}
diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json
index 5b42fc6db..dd2b256af 100644
--- a/src/public/translations/cn/translation.json
+++ b/src/public/translations/cn/translation.json
@@ -1301,7 +1301,7 @@
},
"multi_factor_authentication": {
"title": "多因素认证(MFA)",
- "description": "多因素认证(MFA)为您的账户添加了额外的安全层。除了输入密码登录外,MFA还要求您提供一个或多个额外的验证信息来验证您的身份。这样,即使有人获得了您的密码,没有第二个验证信息他们也无法访问您的账户。这就像给您的门添加了一把额外的锁,让他人更难闯入。",
+ "description": "多因素认证(MFA)为您的账户添加了额外的安全层。除了输入密码登录外,MFA还要求您提供一个或多个额外的验证信息来验证您的身份。这样,即使有人获得了您的密码,没有第二个验证信息他们也无法访问您的账户。这就像给您的门添加了一把额外的锁,让他人更难闯入。
请按照以下说明启用 MFA。如果您配置不正确,登录将仅使用密码。",
"mfa_enabled": "启用多因素认证",
"mfa_method": "MFA 方法",
"electron_disabled": "当前桌面版本不支持多因素认证。",
@@ -1310,13 +1310,14 @@
"totp_secret_title": "生成 TOTP 密钥",
"totp_secret_generate": "生成 TOTP 密钥",
"totp_secret_regenerate": "重新生成 TOTP 密钥",
+ "no_totp_secret_warning": "要启用 TOTP,您需要先生成一个 TOTP 密钥。",
"totp_secret_description_warning": "生成新的 TOTP 密钥后,您需要使用新的 TOTP 密钥重新登录。",
"totp_secret_generated": "TOTP 密钥已生成",
"totp_secret_warning": "请将生成的密钥保存在安全的地方。它将不会再次显示。",
"totp_secret_regenerate_confirm": "您确定要重新生成 TOTP 密钥吗?这将使之前的 TOTP 密钥失效,并使所有现有的恢复代码失效。请将生成的密钥保存在安全的地方。它将不会再次显示。",
"recovery_keys_title": "单点登录恢复密钥",
- "recovery_keys_description": "单点登录恢复密钥用于在无法访问您的认证器代码时登录。请将它们保存在安全的地方。",
- "recovery_keys_description_warning": "恢复密钥使用后将无法再次使用。",
+ "recovery_keys_description": "单点登录恢复密钥用于在您无法访问您的认证器代码时登录。离开页面后,恢复密钥将不会再次显示。请将它们保存在安全的地方。",
+ "recovery_keys_description_warning": "离开页面后,恢复密钥将不会再次显示。请将它们保存在安全的地方。
一旦恢复密钥被使用,它将无法再次使用。",
"recovery_keys_error": "生成恢复代码时出错",
"recovery_keys_no_key_set": "未设置恢复代码",
"recovery_keys_generate": "生成恢复代码",
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index aef3ce8e6..7d9d3fe21 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -1312,7 +1312,7 @@
},
"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.",
+ "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.
Please follow the instructions below to enable MFA. If you don't config correctly, login will fall back to password only.",
"mfa_enabled": "Enable Multi-Factor Authentication",
"mfa_method": "MFA Method",
"electron_disabled": "Multi-Factor Authentication is not supported in the desktop build currently.",
@@ -1321,13 +1321,14 @@
"totp_secret_title": "Generate TOTP Secret",
"totp_secret_generate": "Generate TOTP Secret",
"totp_secret_regenerate": "Regenerate TOTP Secret",
+ "no_totp_secret_warning": "To enable TOTP, you need to generate a TOTP secret first.",
"totp_secret_description_warning": "After generating a new TOTP secret, you will be required to login again with the new TOTP secret.",
"totp_secret_generated": "TOTP Secret Generated",
"totp_secret_warning": "Please save the generated secret in a secure location. It will not be shown again.",
"totp_secret_regenerate_confirm": "Are you sure you want to regenerate the TOTP secret? This will invalidate previous TOTP secret and all existing recovery codes.",
"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.",
+ "recovery_keys_description": "Single sign-on recovery keys are used to login in the even you cannot access your Authenticator codes.",
+ "recovery_keys_description_warning": "Recovery keys won't be shown again after leaving the page, keep them somewhere safe and secure.
After a recovery key is used it cannot be used again.",
"recovery_keys_error": "Error generating recovery codes",
"recovery_keys_no_key_set": "No recovery codes set",
"recovery_keys_generate": "Generate Recovery Codes",
@@ -1336,8 +1337,8 @@
"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. Follow these instructions to setup an OpenID service through google.",
"oauth_description_warning": "To enable OAuth/OpenID, you need to set the OAuth/OpenID base URL, client ID and client secret in the config.ini file and restart the application.",
"oauth_missing_vars": "Missing variables: ",
- "oauth_user_account": "User Account:",
- "oauth_user_email": "User Email:",
+ "oauth_user_account": "User Account: ",
+ "oauth_user_email": "User Email: ",
"oauth_user_not_logged_in": "Not logged in!"
},
"shortcuts": {