Skip to content

Commit

Permalink
Give a little more leeway in TOTP verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Moc committed Feb 20, 2021
1 parent 200b1f1 commit 65f3a0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twofactorauth_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private function verifyTotp($user_id = USERID, $totp)
}

// Check if the entered TOTP is correct.
if($tfa_library->verifyCode($secret_key, $totp) === true)
if($tfa_library->verifyCode($secret_key, $totp, 2) === true)
{
// TOTP is correct.
if($this->tfa_debug)
Expand Down Expand Up @@ -228,7 +228,7 @@ public function processEnable($user_id = USERID, $secret_key, $totp)
$tfa_library = new TwoFactorAuth();

// Verify code
if($tfa_library->verifyCode($secret_key, $totp) === false)
if($tfa_library->verifyCode($secret_key, $totp, 2) === false)
{
if($this->tfa_debug)
{
Expand Down Expand Up @@ -277,7 +277,7 @@ public function processDisable($user_id = USERID, $totp)
$secret_key = e107::getUserExt()->get($user_id, "user_plugin_twofactorauth_secret_key");

// Verify code
if($tfa_library->verifyCode($secret_key, $totp) === false)
if($tfa_library->verifyCode($secret_key, $totp, 2) === false)
{
e107::getMessage()->addError(LAN_2FA_INCORRECT_TOTP);
return false;
Expand Down

0 comments on commit 65f3a0a

Please sign in to comment.