mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-25 16:15:49 +03:00
[GH-ISSUE #134] Null values on verifyKeyNewer regression #298
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @williamhector on GitHub (Jan 28, 2020).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/134
When a user account is logging in for the first time and they don't yet have an old timestamp to provide to
verifyKeyNewer, calling it doesn't get a new timestamp returned for next time either, only atruevalue.This seems to have been previously addressed in #70 and
592ca6f021and then regressed inffdcb8231dwith the change back to usingis_null($oldTimestamp)infindValidOTP.Current workaround for me is to check if the result of
verifyKeyNeweristrueand if so, set the user's 2fa timestamp to the result ofgetTimestamp.@antonioribeiro commented on GitHub (Apr 4, 2020):
@williamhector, this is actually the behavior of
findValidOTP, since forever:https://github.com/antonioribeiro/google2fa/blob/8.x/src/Google2FA.php#L83