Skip to content

Commit

Permalink
Merge pull request #525 from edegaudenzi/feature/524_cant_scan_qrcode…
Browse files Browse the repository at this point in the history
…_fix

#524 Two Factor - Authenticator App - now offers the end-user a "Can'…
  • Loading branch information
maxxer authored Jan 4, 2024
2 parents aa8cd06 + be1db7d commit 3ecb5f6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- Fix #530: Welcome email: reported Password is now HTML-encoded

## 1.6.1 March 4th, 2023
Expand Down
2 changes: 1 addition & 1 deletion src/User/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions src/User/resources/i18n/es/usuario.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/User/resources/i18n/fr/usuario.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/User/resources/i18n/it/usuario.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 7 additions & 0 deletions src/User/resources/views/settings/two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/** @var string $id */
/** @var string $uri */
/** @var Da\User\Model\User $user */
?>

<div class="alert alert-info" id="tfmessage">
Expand All @@ -26,6 +27,12 @@
<img id="qrCode" src="<?= $uri ?>"/>
</div>
</div>
<div class="row">
<div class="col-md-offset-3 col-md-6 text-center">
<a href="#" onclick="this.nextElementSibling.style.display = (this.nextElementSibling.style.display === '' ? 'none' : '');"><?= Yii::t('usuario', 'Can\'t scan? Copy the code instead.') ?></a>
<pre style="display:none;"><?= $user->auth_tf_key ?></pre>
</div>
</div>
<div class="row">
<div class="col-md-offset-3 col-md-6 text-center">
<div class="input-group">
Expand Down

0 comments on commit 3ecb5f6

Please sign in to comment.