#524 Two Factor - Authenticator App - now offers the end-user a "Can't scan?" fallback

This commit is contained in:
enrico.degaudenzi@connectorly.io
2023-10-06 15:49:31 +01:00
parent 723ae81d11
commit bbd206ac1c
5 changed files with 11 additions and 1 deletions

View File

@ -473,7 +473,7 @@ class SettingsController extends Controller
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]);

View File

@ -57,6 +57,7 @@ return [
'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',

View File

@ -56,6 +56,7 @@ return [
'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',

View File

@ -53,6 +53,7 @@ return [
'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',

View File

@ -10,6 +10,7 @@
/** @var string $id */
/** @var string $uri */
/** @var Da\User\Model\User $user */
?>
<div class="alert alert-info" id="tfmessage">
@ -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">