From 7284608c2f8e9e0a880135fa17e0a2206d29af33 Mon Sep 17 00:00:00 2001 From: Tom Maaswinkel Date: Tue, 8 Sep 2020 11:36:29 +0200 Subject: [PATCH] Don't sleep when validation succesfull Currently the validate function will always sleep, even if the validation was succesfull. Sleeping is only needed when we need to retry. --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index efc935b..655610f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -297,7 +297,7 @@ class Client $this->signPayloadKid(null, $challenge->getAuthorizationURL()) ); $data = json_decode((string)$response->getBody(), true); - if ($maxAttempts > 1) { + if ($maxAttempts > 1 && $data['status'] != 'valid') { sleep(ceil(15 / $maxAttempts)); } $maxAttempts--;