mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-25 16:15:49 +03:00
[GH-ISSUE #193] Code timing incorrect #323
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#323
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 @JamieCee20 on GitHub (Jan 4, 2024).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/193
I have generated the secret, and in my authenticator both entered the key and used the qr code, both return the same codes.
However, when running the
Google2FA::verifyGoogle2FA($result, $code, $timeWindow);method, it always returns false until the code changes between 2-4 times. So why is the code in the verify so delayed to what the authenticator is giving me? This also means after the code keeps changing, older codes still work. My window has been changed varying between 0 and 4, still having the same issue@Fludem commented on GitHub (Feb 12, 2024):
Hey,
Have you checked the time on the machine hosting your code?
Can you try again on a different machine?
Can you also manually pass a timestamp to the methods of a fixed time where you know what the correct outcomes are so it doesn't rely on your the hosts time?
@JamieCee20 commented on GitHub (Feb 12, 2024):
@Fludem Ah I forgot to update the ticket. Yeah, so I found out my machine was 2 minutes out of sync with the current time (Not sure how that ended up happening as it should have been set to automatic) But I correct that and its back working