Skip to content

Commit 35b803c

Browse files
author
Patrik Pekarcik
committed
feat: add 30s grace period for access token expiration
1 parent 45f871c commit 35b803c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Http/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function request(string $method, string $path = '', array $options = []):
6868

6969
public function isAuthorized(): bool
7070
{
71-
return $this->tokenStorage->retrieveAccessToken()?->isExpired(new DateTime()) === false;
71+
return $this->tokenStorage->retrieveAccessToken()?->isExpired((new DateTime())->add(new \DateInterval("PT30S"))) === false;
7272
}
7373

7474
private function authorize(): void

0 commit comments

Comments
 (0)