PHPGangsta / GoogleAuthenticator

PHP class to generate and verify Google Authenticator 2-factor authentication

Home Page:http://phpgangsta.de/4376

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Method verifyCode returns nothing

Johnny99211 opened this issue · comments

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

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

I used it today. Seems to work fine.

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).

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...).