Skip to content

Commit

Permalink
only refresh token if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
emnbdx committed Feb 24, 2025
1 parent 859e83d commit e119789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/ApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function getAccessTokensAndRefreshIfNecessary($organization_slug): ?Acces
return null;
}
} else {
if ($tokenData->access_token_expires_at < new DateTime()) {
if (new DateTime($tokenData->access_token_expires_at) < new DateTime()) {
$tokenData = $this->refreshToken($tokenData->refresh_token, $organization_slug);
return $tokenData;
}
Expand Down

0 comments on commit e119789

Please sign in to comment.