fix: minor tweaking of 2fa generation box

This commit is contained in:
Julian Lam 2023-06-12 11:06:54 -04:00
parent 376089c10b
commit 639b90bce8
8 changed files with 42 additions and 39 deletions

View file

@ -26,7 +26,8 @@
"user.manage.disableAuthn": "Are you sure you wish to dissociate your hardware key?",

"generate.title": "Generate Token & Set up Device",
"generate.text": "The QR code shown above will allow you to associate your mobile device (via the GAuthenticator app or a suitable variant) with your account on this website. Simply scan it via the app, and key in the generated token to confirm.",
"generate.text": "The QR code shown above will allow you to associate your mobile device (via the Authenticator app or a suitable variant) with your account on this website. Simply scan it via the app, and key in the generated token to confirm.",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "Keep this token safe! Others can use it to register their devices with your account.",
"generate.safety.text": "For security purposes, the QR code will only be shown here. In the event your device is lost or is otherwise unavailable, you will not be able to log into NodeBB unless 2FA is deactivated on your account.",
"generate.success": "Successfully enabled Two-Factor Authentication!",

View file

@ -19,6 +19,7 @@

"generate.title": "ایجاد توکن و اتصال دستگاه",
"generate.text": "کد QR ای که بالا نمایش داده شده امکان اتصال دستگاه تلفن همراه شما (به کمک برنامه Google Authenticator یا موارد مناسب دیگر) به حساب کاربری شما در انجمن را فراهم می سازد. کد را با برنامه اسکن کنید و توکن ایحاد شده را تایید کنید.",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "این توکن را در اختیار کسی نگذارید! دیگران قادر به استفاده از آن برای اتصال دستگاه به حساب کاربری شما می باشند.",
"generate.safety.text": "به دلایل امنیتی، کد QR فقط اینجا قابل مشاهده خواهد بود. در صورت از دست دادن تلفن همراه یا در دسترس نبودن آن، شما قادر به ورود به حساب کاربری خود نخواهید بود مگر آنکه تایید دو مرحله ای در حساب کاربری شما غیرفعال شود.",
"generate.success": "تایید دو مرحله ای با موفقیت فعال شد!",

View file

@ -9,7 +9,7 @@
"notification.backupCode.used": "Un code de sauvegarde vient d'être utilisé pour se connecter à ce compte",

"user.intro.one": "En plus de l'authentification régulière par nom d'utilisateur / mot de passe ou SSO, une seconde authentification peut être configurée, permettant l'accès que si un mot de passe basé sur le temps est fourni, généralement généré / stockée sur un appareil mobile.",
"user.intro.two": "Pour activer l'authentification à deux facteurs, cliquez sur le bouton ci-dessous pour générer un jeton pour NodeBB. Une fois généré, scanner-le dans votre appareil mobile via le GAuthenticator (ou une application similaire). Enfin, confirmer la configuration en entrant le mot de passe basé sur le temps dans l'écran de confirmation.",
"user.intro.two": "Pour activer l'authentification à deux facteurs, cliquez sur le bouton ci-dessous pour générer un jeton pour NodeBB. Une fois généré, scanner-le dans votre appareil mobile via le Authenticator (ou une application similaire). Enfin, confirmer la configuration en entrant le mot de passe basé sur le temps dans l'écran de confirmation.",
"user.intro.three": "Une fois la configuration effectuée, il faudra fournir le mot de passe et le mot de passe basé sur le temps pour vous connecter",
"user.settings.title": "Paramètre de l'authentification à deux facteurs",
"user.settings.enable": "Activer l'authentification à deux facteurs",
@ -18,7 +18,8 @@
"user.force_2fa": "The administrator has required you to setup 2FA for your account for security purposes",

"generate.title": "Générer un jeton & Configuré le mobile",
"generate.text": "Le code QR ci-dessus vous permettra d'associer votre appareil mobile (via l'application GAuthenticator ou une application similaire) avec votre compte sur ce site. Il suffit de le numériser via l'application, et de renseigner la clé générée dans l'application pour confirmer.",
"generate.text": "Le code QR ci-dessus vous permettra d'associer votre appareil mobile (via l'application Authenticator ou une application similaire) avec votre compte sur ce site. Il suffit de le numériser via l'application, et de renseigner la clé générée dans l'application pour confirmer.",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "Gardez ce jeton en toute sécurité ! D'autres peuvent l'utiliser pour enregistrer leurs appareils avec votre compte.",
"generate.safety.text": "Pour des raisons de sécurité, le code QR ne sera montré uniquement sur cette page. Dans le cas où votre mobile n'est plus disponible, vous ne pourrez vous connecter sur ce site sauf si vous désactiver l'authentification à deux facteurs.",
"generate.success": "L'authentification à deux facteurs est maintenant activé",

View file

@ -9,7 +9,7 @@
"notification.backupCode.used": "È stato appena utilizzato un codice di backup per accedere a questo account",

"user.intro.one": "Oltre all'autenticazione classica tramite username/password o SSO, è possibile configurare un secondo livello di protezione, viene consentito l'accesso solo se viene fornita la one-time password, solitamente generata tramite un dispositivo mobile.",
"user.intro.two": "Per abilitare l'autenticazione a due fattori, fare clic sul pulsante in basso al fine di generare un token per NodeBB. Successivamente, scansiona con il tuo dispositivo mobile, tramite GAuthenticator (o un'altra app simile). Infine, conferma l'impostazione inserendo nella scermata di conferma la password generata.",
"user.intro.two": "Per abilitare l'autenticazione a due fattori, fare clic sul pulsante in basso al fine di generare un token per NodeBB. Successivamente, scansiona con il tuo dispositivo mobile, tramite Authenticator (o un'altra app simile). Infine, conferma l'impostazione inserendo nella scermata di conferma la password generata.",
"user.intro.three": "Una volta configurato, il login non sarà confermato fino a quando non viene fornita sia la password che il token generato.",
"user.settings.title": "Impostazioni autenticazione a due fattori",
"user.settings.enable": "Abilita autenticazione a due fattori",
@ -18,7 +18,8 @@
"user.force_2fa": "The administrator has required you to setup 2FA for your account for security purposes",

"generate.title": "Genera Token & Configura dispositivo",
"generate.text": "Il codice QR mostrato in precedenza consentirà di associare il tuo dispositivo mobile (tramite l'app GAuthenticator o una variante appropriata) con il tuo account su questo sito. È sufficiente scansionarlo tramite l'app e digitare il token generato per confermare.",
"generate.text": "Il codice QR mostrato in precedenza consentirà di associare il tuo dispositivo mobile (tramite l'app Authenticator o una variante appropriata) con il tuo account su questo sito. È sufficiente scansionarlo tramite l'app e digitare il token generato per confermare.",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "Mantieni questo token al sicuro! Altri possono utilizzarlo per registrare i propri dispositivi con il tuo account.",
"generate.safety.text": "Per scopi di sicurezza, il QR code verrà mostrato solo qui. Nel caso in cui il tuo dispositivo venga perso o non sia a te disponibile, non sarai in grado di accedere a NodeBB a meno che non disattivi 2FA dal tuo account.",
"generate.success": "Doppia autenticazione abilitata con successo!",

View file

@ -19,6 +19,7 @@

"generate.title": "Wygeneruj tymczasowy kod & Skonfiguruj urządzenie",
"generate.text": "Powyższy kod QR pozwoli ci skojarzyć Twoje urządzenie mobilne (za pośrednictwem aplikacji Google Authenticator lub odpowiedniego wariantu) z Twoim kontem na tej stronie. Wystarczy zeskanować go za pomocą aplikacji i wprowadzić wygenerowany kod w celu potwierdzenia.",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "Zachowaj ten kod w bezpiecznym miejscu! Inni mogą go użyć do zarejestrowania swoich urządzeń z przy użyciu Twojego konta.",
"generate.safety.text": "Ze względów bezpieczeństwa kod QR zostanie wyświetlony tylko tutaj. Jeśli urządzenie zostanie zgubione lub w inny sposób niedostępne, nie będziesz mógł zalogować się na forum dopóki 2FA nie zostanie dezaktywowane na Twoim koncie.",
"generate.success": "Pomyślnie włączono weryfikacje dwuetapową dla Twojego konta, gratulacje!",

View file

@ -9,7 +9,7 @@
"notification.backupCode.used": "一个备份代码刚刚被用来登录这个帐号",

"user.intro.one": "在常规的用户名/密码或单点登录 (SSO) 之外,您还可以为帐号增加第二层安全认证,在此之后,您将需要输入一个基于时间的一次性密码来登录您的帐号。这样的密码通常在您的移动设备上生成和储存。",
"user.intro.two": "要启用双因素身份认证,请单击下面的按钮为 NodeBB 生成令牌。 生成后,通过 GAuthenticator (或其他类似的应用程序)将其扫描到您的移动设备。 最后,通过在确认屏幕中输入基于当前时间的密码来完成设置。",
"user.intro.two": "要启用双因素身份认证,请单击下面的按钮为 NodeBB 生成令牌。 生成后,通过 Authenticator (或其他类似的应用程序)将其扫描到您的移动设备。 最后,通过在确认屏幕中输入基于当前时间的密码来完成设置。",
"user.intro.three": "一旦启用此认证,您在访问您的账号时将需要输入常规密码和一次性密码。",
"user.settings.title": "两步认证设置",
"user.settings.enable": "启用两步认证",
@ -18,7 +18,8 @@
"user.force_2fa": "The administrator has required you to setup 2FA for your account for security purposes",

"generate.title": "生成令牌并设置设备",
"generate.text": "请扫描此二维码(通过 GAuthenticator 应用或其他类似应用)来关联您的移动设备和您在此网站上的帐号,并输入生成的令牌进行确认。",
"generate.text": "请扫描此二维码(通过 Authenticator 应用或其他类似应用)来关联您的移动设备和您在此网站上的帐号,并输入生成的令牌进行确认。",
"generate.manual-entry": "If you wish to add your token manually, you can do so with the encoded key below:",
"generate.safety.title": "请不要泄露此二维码!其他人可以以此将您的帐号关联至他们的设备。",
"generate.safety.text": "为了安全起见, 如果您的设备丢失或无法使用,您将无法登录 NodeBB ,除非您的帐号停用了 2FA。",
"generate.success": "您成功启用了两步认证!",

View file

@ -1,6 +1,6 @@
'use strict';

define('forum/account/2factor', ['translator', 'benchpress', 'api', 'alerts'], function (translator, bch, api, alerts) {
define('forum/account/2factor', ['translator', 'benchpress', 'api', 'alerts', 'bootbox'], function (translator, bch, api, alerts, bootbox) {
var Settings = {};

Settings.init = function () {
@ -15,18 +15,19 @@ define('forum/account/2factor', ['translator', 'benchpress', 'api', 'alerts'], f
};

Settings.setupTotp = function () {
socket.emit('plugins.2factor.regenerate', function (err, data) {
socket.emit('plugins.2factor.regenerate', async (err, data) => {
if (err) {
return app.alertError(err);
}

bch.parse('partials/2factor/generate', data, function (html) {
translator.translate(html, function (translatedHTML) {
translator.translate('[[2factor:generate.title]]', function (title) {
var modal = bootbox.dialog({
title: title,
message: translatedHTML,
});
const html = await bch.render('partials/2factor/generate', data);
const [message, title] = await Promise.all([
translator.translate(html),
translator.translate('[[2factor:generate.title]]'),
]);
const size = 'lg';

var modal = bootbox.dialog({ title, message, size });
var formEl = modal.find('form');
var confirmEl = modal.find('button[data-action="confirm"]');
var codeEl = modal.find('.2fa-confirm');
@ -44,9 +45,6 @@ define('forum/account/2factor', ['translator', 'benchpress', 'api', 'alerts'], f
codeEl.focus();
});
});
});
});
});
};

Settings.disableTotp = () => {

View file

@ -1,10 +1,8 @@
<div class="row">
<div class="col-6">
<div class="d-flex gap-5 align-items-center">
<div class="text-center">
<img src="{qr}" />
</div>
</div>
<div class="col-6">
<div>
<p>
[[2factor:generate.text]]
</p>
@ -16,8 +14,9 @@
</form>
</div>
</div>
<div class="text-center mt-3">
<p><code>{encodedKey}</code></p>
<div class="text-center mt-3 pt-3 border-top">
<p>[[2factor:generate.manual-entry]]</p>
<p class="font-monospace user-select-all text-info">{encodedKey}</p>
<p><strong>[[2factor:generate.safety.title]]</strong></p>
<p class="help-block">[[2factor:generate.safety.text]]</p>
</div>