yii2-netdisk/views/user/verifyTwoFactor.php
Chenx221 220b1abff6
实现恢复代码登录账户功能
*目前的安全策略是使用过的恢复代码将会失效
*其实想做的是在恢复后自动关掉二步验证:)
2024-03-08 16:43:22 +08:00

36 lines
1.1 KiB
PHP

<?php
use yii\bootstrap5\Html;
use yii\bootstrap5\ActiveForm;
/** @var yii\web\View $this */
/** @var app\models\User $model */
$this->title = '2FA验证';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-login-2fa">
<h1><?= Html::encode($this->title) ?></h1>
<p>请在下方输入二步验证代码:</p>
<div class="row">
<div class="col-lg-5">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'totp_input')->passwordInput()->label('二步验证代码') ?>
<div class="form-group">
<?= Html::submitButton('提交', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
<hr>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'recoveryCode_input')->textInput()->label('丢失所有验证设备? 使用恢复代码') ?>
<div class="form-group">
<?= Html::submitButton('恢复账户', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div><!-- user-login-2fa -->