Skip to content

Commit

Permalink
fix erroneous loop and status check (also suggested by mgilfillan)
Browse files Browse the repository at this point in the history
  • Loading branch information
lordelph committed Mar 17, 2020
1 parent c2532e0 commit eec278c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ public function validate(Challenge $challenge, $maxAttempts = 15): bool
);
$data = json_decode((string)$response->getBody(), true);
sleep(1);
} while ($maxAttempts < 0 && $data['status'] == 'pending');
} while ($maxAttempts > 0 && $data['status'] == 'pending');

return (isset($data['status']) && $data['status'] == 'ready');
return (isset($data['status']) && $data['status'] == 'valid');
}

/**
Expand Down

0 comments on commit eec278c

Please sign in to comment.