Fixes for refreshing tokens

This commit is contained in:
David Bomba 2024-09-23 12:44:34 +10:00
parent 8f83ca660c
commit d87f8d8be0

View File

@ -105,10 +105,7 @@ class SdkWrapper
$this->setAccessToken($token);
if($token_object->accessTokenExpiresAt < time()){
$new_token = $this->sdk->getOAuth2LoginHelper()->refreshAccessTokenWithRefreshToken($token_object->refresh_token);
$this->setAccessToken($new_token);
$this->saveOAuthToken($this->accessToken());
$this->refreshToken($token_object->refresh_token);
}
return $this;
@ -119,7 +116,6 @@ class SdkWrapper
{
$new_token = $this->sdk->getOAuth2LoginHelper()->refreshAccessTokenWithRefreshToken($refresh_token);
nlog($new_token);
$this->setAccessToken($new_token);
$this->saveOAuthToken($this->accessToken());