Skip to content

Commit

Permalink
Token Expiry Issue
Browse files Browse the repository at this point in the history
In some cases the token check and API call can run over 1 second apart which can cause issues if the token check is at the token expiry time, as the API call fails due to an expired token.

This fixes the issue by renewing the token if there is less than 1 minute of expiry on the token.
  • Loading branch information
colinhall17 committed Sep 15, 2022
1 parent bcaba6b commit f02c40e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/Token/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function expires()

public function hasExpired()
{
return time() > $this->expires;
return time() + 60 > $this->expires;
}

public function authenticated()
Expand Down

0 comments on commit f02c40e

Please sign in to comment.