From bbd206ac1c25c2f0c81d40d7438d24efb1c0da28 Mon Sep 17 00:00:00 2001 From: "enrico.degaudenzi@connectorly.io" Date: Fri, 6 Oct 2023 15:49:31 +0100 Subject: [PATCH 1/2] #524 Two Factor - Authenticator App - now offers the end-user a "Can't scan?" fallback --- src/User/Controller/SettingsController.php | 2 +- src/User/resources/i18n/es/usuario.php | 1 + src/User/resources/i18n/fr/usuario.php | 1 + src/User/resources/i18n/it/usuario.php | 1 + src/User/resources/views/settings/two-factor.php | 7 +++++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/User/Controller/SettingsController.php b/src/User/Controller/SettingsController.php index 7d476f3e..a96040bc 100644 --- a/src/User/Controller/SettingsController.php +++ b/src/User/Controller/SettingsController.php @@ -473,7 +473,7 @@ public function actionTwoFactor($id) switch ($choice) { case 'google-authenticator': $uri = $this->make(TwoFactorQrCodeUriGeneratorService::class, [$user])->run(); - return $this->renderAjax('two-factor', ['id' => $id, 'uri' => $uri]); + return $this->renderAjax('two-factor', ['id' => $id, 'uri' => $uri, 'user' => $user]); case 'email': $emailCode = $this->make(TwoFactorEmailCodeGeneratorService::class, [$user])->run(); return $this->renderAjax('two-factor-email', ['id' => $id, 'code' => $emailCode]); diff --git a/src/User/resources/i18n/es/usuario.php b/src/User/resources/i18n/es/usuario.php index 28394d28..3360803b 100644 --- a/src/User/resources/i18n/es/usuario.php +++ b/src/User/resources/i18n/es/usuario.php @@ -57,6 +57,7 @@ 'Block' => 'Bloquear', 'Block status' => 'Estado de bloqueo', 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Bloqueado el {0, date, dd MMMM, YYYY HH:mm}', + 'Can\'t scan? Copy the code instead.' => '¿No puedes escanear? Copie el código.', 'Cancel' => 'Cancelar', 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => 'No se puede asignar rol "{0}" ya que AuthManager no ha sido configurado en su aplicación de consola.', 'Change your avatar at Gravatar.com' => 'Cambie su avatar en Gravatar.com', diff --git a/src/User/resources/i18n/fr/usuario.php b/src/User/resources/i18n/fr/usuario.php index d165c4ee..8a8051ce 100644 --- a/src/User/resources/i18n/fr/usuario.php +++ b/src/User/resources/i18n/fr/usuario.php @@ -56,6 +56,7 @@ 'Block' => 'Verrouiller', 'Block status' => 'État du verrouillage', 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Verrouillé depuis le {0, date, dd MMMM YYYY HH:mm}', + 'Can\'t scan? Copy the code instead.' => 'Ne peut pas numériser? Copiez le code.', 'Cancel' => 'Annuler', 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => 'Impossible d\'assigner le rôle {0} tant que l\'AuthManager n\'est pas configuré depuis la console de l\'application.', 'Change your avatar at Gravatar.com' => 'Changez votre avatar depuis Gravatar.com', diff --git a/src/User/resources/i18n/it/usuario.php b/src/User/resources/i18n/it/usuario.php index 9ed2e712..668cf106 100644 --- a/src/User/resources/i18n/it/usuario.php +++ b/src/User/resources/i18n/it/usuario.php @@ -53,6 +53,7 @@ 'Authorization rule has been updated.' => 'Regola di autorizzazione modificata.', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => 'Fantastico, ci siamo quasi. Ora devi solo visitare il collegamento di conferma che è stato inviato al tuo nuovo indirizzo email.', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => 'Fantastico, ci siamo quasi. Ora devi solo visitare il collegamento di conferma che è stato inviato al tuo vecchio indirizzo email.', + 'Can\'t scan? Copy the code instead.' => 'Non puoi scansionare? Copia il codice.', 'Back to privacy settings' => 'Torna alle impostazioni di privacy', 'Bio' => 'Bio', 'Block' => 'Blocca', diff --git a/src/User/resources/views/settings/two-factor.php b/src/User/resources/views/settings/two-factor.php index 6434396a..439b82e0 100644 --- a/src/User/resources/views/settings/two-factor.php +++ b/src/User/resources/views/settings/two-factor.php @@ -10,6 +10,7 @@ /** @var string $id */ /** @var string $uri */ +/** @var Da\User\Model\User $user */ ?>
@@ -26,6 +27,12 @@
+
+
+ +
auth_tf_key ?>
+
+
From 2c34fc5df4caf423c5dc6bc8e570302448215210 Mon Sep 17 00:00:00 2001 From: "enrico.degaudenzi@connectorly.io" Date: Fri, 22 Dec 2023 14:26:53 +0000 Subject: [PATCH 2/2] #524 Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1aa6634..027708a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Enh: possibility to limit the depth of the recursion when getting user ids from roles (mp1509) - Fix: UserSearch avoid fields name conflict if joined with other tables (liviuk2) - Fix: PasswordExpireService return false when user model attribute "password_changed_at" is already set at null. +- Enh #524: Two Factor - Authenticator App - offer a "Can't scan?" fallback ## 1.6.1 March 4th, 2023