Skip to content

Commit

Permalink
Fix second usage of 2FA code (#399)
Browse files Browse the repository at this point in the history
* Fix second usage of 2FA code

* Update TwoFactorAuthenticationProvider.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
xwillq and taylorotwell authored Aug 9, 2022
1 parent db1e375 commit fc248d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/TwoFactorAuthenticationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public function verify($secret, $code)
);

if ($timestamp !== false) {
if ($timestamp === true) {
$timestamp = $this->engine->getTimestamp();
}

optional($this->cache)->put($key, $timestamp, ($this->engine->getWindow() ?: 1) * 60);

return true;
Expand Down

0 comments on commit fc248d3

Please sign in to comment.