mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for refreshing tokens
This commit is contained in:
parent
8f83ca660c
commit
d87f8d8be0
@ -105,10 +105,7 @@ class SdkWrapper
|
|||||||
$this->setAccessToken($token);
|
$this->setAccessToken($token);
|
||||||
|
|
||||||
if($token_object->accessTokenExpiresAt < time()){
|
if($token_object->accessTokenExpiresAt < time()){
|
||||||
$new_token = $this->sdk->getOAuth2LoginHelper()->refreshAccessTokenWithRefreshToken($token_object->refresh_token);
|
$this->refreshToken($token_object->refresh_token);
|
||||||
|
|
||||||
$this->setAccessToken($new_token);
|
|
||||||
$this->saveOAuthToken($this->accessToken());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -119,7 +116,6 @@ class SdkWrapper
|
|||||||
{
|
{
|
||||||
$new_token = $this->sdk->getOAuth2LoginHelper()->refreshAccessTokenWithRefreshToken($refresh_token);
|
$new_token = $this->sdk->getOAuth2LoginHelper()->refreshAccessTokenWithRefreshToken($refresh_token);
|
||||||
|
|
||||||
nlog($new_token);
|
|
||||||
$this->setAccessToken($new_token);
|
$this->setAccessToken($new_token);
|
||||||
$this->saveOAuthToken($this->accessToken());
|
$this->saveOAuthToken($this->accessToken());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user