From 9879cb0e68f491983dacb3be799dbf8cf25af1f3 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Tue, 18 Oct 2022 16:30:48 +1000 Subject: [PATCH] FIX: Clarify security key copy (#18636) In user preferences, we want to make it more obvious that a security key is a physical device, and also you can use your phone. --- .../controllers/second-factor-add-security-key.js | 14 +++++++++++++- config/locales/client.en.yml | 14 ++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js b/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js index 4b4fec9fb43..9bda6f81c14 100644 --- a/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js +++ b/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js @@ -13,11 +13,23 @@ export default Controller.extend(ModalFunctionality, { errorMessage: null, onShow() { + let securityKeyName; + if (this.capabilities.isIOS && !this.capabilities.isIpadOS) { + securityKeyName = I18n.t( + "user.second_factor.security_key.iphone_default_name" + ); + } else if (this.capabilities.isAndroid) { + securityKeyName = I18n.t( + "user.second_factor.security_key.android_default_name" + ); + } else { + securityKeyName = I18n.t("user.second_factor.security_key.default_name"); + } // clear properties every time because the controller is a singleton this.setProperties({ errorMessage: null, loading: true, - securityKeyName: I18n.t("user.second_factor.security_key.default_name"), + securityKeyName, webauthnUnsupported: !isWebauthnSupported(), }); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 7bcc8992ddb..bb55ec4f1d7 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1393,7 +1393,7 @@ en: edit_title: "Edit Authenticator" edit_description: "Authenticator Name" enable_security_key_description: | - When you have your hardware security key prepared, press the Register button below. + When you have your hardware security key or compatible mobile device prepared, press the Register button below. totp: title: "Token-Based Authenticators" add: "Add Authenticator" @@ -1401,14 +1401,16 @@ en: name_and_code_required_error: "You must provide a name and the code from your authenticator app." security_key: register: "Register" - title: "Security Keys" - add: "Add Security Key" + title: "Physical Security Keys" + add: "Add Physical Security Key" default_name: "Main Security Key" + iphone_default_name: "iPhone" + android_default_name: "Android" not_allowed_error: "The security key registration process either timed out or was cancelled." already_added_error: "You have already registered this security key. You don’t have to register it again." - edit: "Edit Security Key" + edit: "Edit Physical Security Key" save: "Save" - edit_description: "Security Key Name" + edit_description: "Physical Security Key Name" name_required_error: "You must provide a name for your security key." change_about: @@ -2008,7 +2010,7 @@ en: second_factor_backup_title: "Two-Factor Backup" second_factor_backup_description: "Please enter one of your backup codes:" second_factor: "Log in using Authenticator app" - security_key_description: "When you have your physical security key prepared press the Authenticate with Security Key button below." + security_key_description: "When you have your physical security key or compatible mobile device prepared press the Authenticate with Security Key button below." security_key_alternative: "Try another way" security_key_authenticate: "Authenticate with Security Key" security_key_not_allowed_error: "The security key authentication process either timed out or was cancelled."