GoogleAuthenticator icon indicating copy to clipboard operation
GoogleAuthenticator copied to clipboard

Method verifyCode returns nothing

Open Johnny99211 opened this issue 6 years ago • 4 comments

Since today I can't use verifyCode anymore. It returns nothing and there is no error. So maybe you can check it pls?

Johnny99211 avatar Apr 04 '19 10:04 Johnny99211

As you can see, I didn't change the code. Check your error.log file for any errors (Fatal errors or something?). Maybe you updated PHP?

As you can see in the code, verifyCode always returns true or false: https://github.com/PHPGangsta/GoogleAuthenticator/blob/master/PHPGangsta/GoogleAuthenticator.php#L125 "nothing" is not a valid return value :-D

PHPGangsta avatar Apr 04 '19 10:04 PHPGangsta

I used it today. Seems to work fine.

ghost avatar Apr 04 '19 10:04 ghost

Maybe a problem with the german summer time? Because we switched to summer time last weekend. Maybe the function don't checks that? Because when using time(), we're + 1 hour forward than the actual time (which is so stupid).

Johnny99211 avatar Apr 04 '19 10:04 Johnny99211

time() returns the unix timestamp, which is always GMT. Summer time does not affect that.

If it would be something with "wrong timezone": Then verifyCode would always return false. You said it's "nothing", which means NULL? Or what do you mean with "nothing"? Please make a var_dump() on the return value you get.

It's working fine here (I'm also from Germany). It must be something on your server that has changed (because the code did not change, and it is working since many years...).

PHPGangsta avatar Apr 04 '19 10:04 PHPGangsta