mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-28 16:56:36 +01:00
Regression: Fixed broken 2FA form [#2109]
This commit is contained in:
@@ -250,21 +250,26 @@ class LoginController extends AdminController
|
||||
return $this->createRedirectResponse('/');
|
||||
}
|
||||
|
||||
$login = $this->getLogin();
|
||||
|
||||
$this->page = $this->createPage('login');
|
||||
$this->form = $this->getForm('admin-login-twofa');
|
||||
$this->form = $this->getForm('login-twofa');
|
||||
try {
|
||||
$this->checkNonce();
|
||||
} catch (PageExpiredException $e) {
|
||||
$this->setMessage($this->translate('PLUGIN_ADMIN.INVALID_SECURITY_TOKEN'), 'error');
|
||||
|
||||
return $this->createDisplayResponse();
|
||||
// Failed 2FA nonce check, logout and redirect.
|
||||
$login->logout(['admin' => true]);
|
||||
$this->form->reset();
|
||||
|
||||
return $this->createRedirectResponse('/');
|
||||
}
|
||||
|
||||
|
||||
$post = $this->getPost();
|
||||
$data = $post['data'] ?? [];
|
||||
|
||||
$login = $this->getLogin();
|
||||
try {
|
||||
$twoFa = $login->twoFactorAuth();
|
||||
} catch (TwoFactorAuthException $e) {
|
||||
|
||||
Reference in New Issue
Block a user