$existingAccessToken = getAccessTokenFromYourDataStore();
if ($existingAccessToken->hasExpired()) {
$newAccessToken = $provider->getAccessToken('refresh_token', [
'refresh_token' => $existingAccessToken->getRefreshToken()
]);
// Purge old access token and store new access token to your data store.
}
Can the above be changed to:
$existingAccessToken = getAccessTokenFromYourDataStore();
$existingRefreshToken = getRefreshTokenFromYourDataStore();
if ($existingAccessToken->hasExpired()) {
$tokens = $provider->getAccessToken('refresh_token', [
'refresh_token' => $existingRefreshToken
]);
// Purge old access token and store new access token to your data store.
saveNewAccessTokenToYourDataStore($tokens->getToken());
saveNewExpiryToYourDataStore($tokens->getExpiry());
}
Hello
I've been working with your oauth2 client example for a few weeks and have some improvements that would have helped me when I started.
https://oauth2-client.thephpleague.com/usage/
Can the above be changed to: