Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit fe4247f

Browse files
committed
Merge pull request #121 from enygma/fix-authy-test
Fix authy test
2 parents 48331b1 + b14a520 commit fe4247f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/phpSec/Auth/Authy.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ public function verify($authyId, $token) {
118118
}
119119

120120
if(isset($result->errors)) {
121-
if(isset($result->errors->token)) {
121+
if(
122+
isset($result->errors->message) &&
123+
$result->errors->message == 'token is invalid'
124+
) {
122125
$this->lastError = 'AUTHY_SERVER_BAD_OTP';
123126
} elseif(isset($result->errors->api_key)) {
124127
$this->lastError = 'AUTHY_SERVER_INVALID_API_KEY';
@@ -198,4 +201,4 @@ private function apiCall($action, $data) {
198201

199202
return json_decode($result);
200203
}
201-
}
204+
}

0 commit comments

Comments
 (0)