mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-06-11 01:20:21 -04:00
Verify 2fa token properly
This commit is contained in:
parent
2471231d01
commit
3cc2bdc229
1 changed files with 1 additions and 2 deletions
|
|
@ -44,10 +44,9 @@ class Challenge2FAForm extends LoginForm
|
|||
|
||||
public function onSuccess()
|
||||
{
|
||||
// TODO: Implement proper 2FA code validation
|
||||
$user = Auth::getInstance()->getUser();
|
||||
$totp = IcingaTotp::loadFromDb($this->getDb(), $user->getUsername());
|
||||
if ($totp->verify($_POST['token'])) {
|
||||
if ($this->getElement('token') && $totp->verify($this->getValue('token'))) {
|
||||
$auth = Auth::getInstance();
|
||||
$user = $auth->getUser();
|
||||
$user->setTwoFactorSuccessful(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue