Closed HectorGamboa closed 11 months ago
Hi @HectorGamboa
When you're initializing the client, you can try and use 'prompt' => 'consent'
option to force generate the access token and refresh token every time.
$client = new \Google_Client([
'access_type' => 'offline',
'prompt' => 'consent'
]);
A side effect is that this will force the approval UI to be visible every time.
From what I understand, this happens because the Oauth server responds with the refresh_token only the first time you authenticate in a time window, after that you only get the access token.
Using the prompt
option forces the server to return a refresh token every time.