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

Commit 0d0847e

Browse files
committed
Fixing Authy test because it seems they changed the API response
1 parent 2ca9324 commit 0d0847e

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
@@ -119,7 +119,10 @@ public function verify($authyId, $token) {
119119
}
120120

121121
if(isset($result->errors)) {
122-
if(isset($result->errors->token)) {
122+
if(
123+
isset($result->errors->message) &&
124+
$result->errors->message == 'token is invalid'
125+
) {
123126
$this->lastError = 'AUTHY_SERVER_BAD_OTP';
124127
} elseif(isset($result->errors->api_key)) {
125128
$this->lastError = 'AUTHY_SERVER_INVALID_API_KEY';
@@ -199,4 +202,4 @@ private function apiCall($action, $data) {
199202

200203
return json_decode($result);
201204
}
202-
}
205+
}

0 commit comments

Comments
 (0)