Loading src/Two/SageProvider.php +3 −2 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface $now = Carbon::now(); //dd($now->timestamp, Carbon::parse($tokenInfo->access_expires)->timestamp); // Si el token a expirado hay que solicitar un nuevo token usando el de refresco si este no ha expirado Log::debug('Verificar active token'); if ($now->timestamp > Carbon::parse($tokenInfo->access_expires)->timestamp) { // Necesitamos un nuevo token // https://oauth.accounting.sage.com/token Loading Loading @@ -311,7 +312,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface 'scope' => $auth_token['scope'], 'access' => $auth_token['access_token'], 'refresh' => $auth_token['refresh_token'], 'access_expires' => Carbon::now()->addSeconds($auth_token['expires_in']), 'access_expires' => (Carbon::now()->addSeconds($auth_token['expires_in']-30)), 'refresh_expires' => Carbon::now()->addSeconds($auth_token['refresh_token_expires_in']) ] ); Loading @@ -324,7 +325,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface 'scope' => $auth_token['scope'], 'access' => $auth_token['access_token'], 'refresh' => $auth_token['refresh_token'], 'access_expires' => Carbon::now()->addSeconds($auth_token['expires_in']), 'access_expires' => (Carbon::now()->addSeconds($auth_token['expires_in']-30)), 'refresh_expires' => Carbon::now()->addSeconds($auth_token['refresh_token_expires_in']) ] ); Loading Loading
src/Two/SageProvider.php +3 −2 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface $now = Carbon::now(); //dd($now->timestamp, Carbon::parse($tokenInfo->access_expires)->timestamp); // Si el token a expirado hay que solicitar un nuevo token usando el de refresco si este no ha expirado Log::debug('Verificar active token'); if ($now->timestamp > Carbon::parse($tokenInfo->access_expires)->timestamp) { // Necesitamos un nuevo token // https://oauth.accounting.sage.com/token Loading Loading @@ -311,7 +312,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface 'scope' => $auth_token['scope'], 'access' => $auth_token['access_token'], 'refresh' => $auth_token['refresh_token'], 'access_expires' => Carbon::now()->addSeconds($auth_token['expires_in']), 'access_expires' => (Carbon::now()->addSeconds($auth_token['expires_in']-30)), 'refresh_expires' => Carbon::now()->addSeconds($auth_token['refresh_token_expires_in']) ] ); Loading @@ -324,7 +325,7 @@ class SageProvider extends AbstractProvider implements ProviderInterface 'scope' => $auth_token['scope'], 'access' => $auth_token['access_token'], 'refresh' => $auth_token['refresh_token'], 'access_expires' => Carbon::now()->addSeconds($auth_token['expires_in']), 'access_expires' => (Carbon::now()->addSeconds($auth_token['expires_in']-30)), 'refresh_expires' => Carbon::now()->addSeconds($auth_token['refresh_token_expires_in']) ] ); Loading