X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=lib%2Fga4php.php;fp=lib%2Fga4php.php;h=784a9189d356f1c42e7b37c2d3eeaf8a5aeea485;hp=6c4e15683f9a6b97acc92203a2c3d78766e7a1bf;hb=fd3cf37febb90cd50fc43ac694f10c21d45e4dbe;hpb=fd26ac6447a5c17ea654dcaa0a80a2a727ea4fe5 diff --git a/lib/ga4php.php b/lib/ga4php.php index 6c4e156..784a918 100644 --- a/lib/ga4php.php +++ b/lib/ga4php.php @@ -250,7 +250,10 @@ abstract class GoogleAuthenticator { $data = $this->internalGetData($user); $toktype = $data["tokentype"]; $key = $this->helperhex2b32($data["tokenkey"]); - $counter = $data["tokencounter"]; + + // token counter should be one more then current token value, otherwise + // it gets confused + $counter = $data["tokencounter"]+1; $toktype = strtolower($toktype); if($toktype == "hotp") { $url = "otpauth://$toktype/$user?secret=$key&counter=$counter";