Open anilthedev opened 5 years ago
As always: Check the time on the server and on your device. They have to be in sync.
$discrepancy=1
means: 1 code before the current one, and the next code will be allowed.
I guess your device is 30-60 seconds away from the server, that's why sometimes the code is invalid.
Sync the time of the device to the server, or increase $discrepancy
to allow more codes.
Hi Thanks for the update. I have checked the $discrepancy value to 3 and checked both the server time and my mobile time both are in sync. Can you please let me know is there any other dependencies.
Thanks
This issue happens to us also. It seems some 30 second intervals it works and returns true, others it will always return false, even if the code is correct. We have synced clocks and it didn't help.
I had a similar problem. Check out keykrusshas Workaround in https://github.com/PHPGangsta/GoogleAuthenticator/issues/61#issuecomment-482079577. It solved it for me. (Setting mbstring.func_overload to 0 did not).
Hi there,
We are using this library in our application from the past few years but recently we are facing issue in enabling the 2 step authentication in our application.
While debugging we found that the verfiyCode function returning false. We are calling the function with the following parameters: $discrepancy = 1 $currentTimeSlice = null and the secret and code.
Please suggest us
Thanks