Skip to content

Commit

Permalink
Fixed updating access token.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raistlfiren committed Dec 5, 2024
1 parent aea2cd7 commit 0337992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Http/GarminClient/GarminAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public function authenticate()
}

// Access token must be expired so lets refresh it
if ($oauthData['refresh_token_expires_at'] < time()) {
if ($oauthData['refresh_token_expires_at'] > time()) {
$this->fetchConsumerCredentials();
// Sweet the refresh token is still good so lets refresh the access token
$oauthData = $this->exchangeOauth1TokenForOauth2Token($oauthData['token'], $oauthData['token_secret']);

$this->refreshFile($filePath, $oauthData);
Expand Down

0 comments on commit 0337992

Please sign in to comment.