It would be awesome if this were supported:
Important: When your application receives a refresh token, it is important to store that refresh token for future use. If your application loses the refresh token, it will have to re-prompt the user for consent before obtaining another refresh token. If you need to re-prompt the user for consent, include the
approval_promptparameter in the authorization code request, and set the value toforce.
— https://developers.google.com/accounts/docs/OAuth2WebServer#offline
This can be achieved like so:
// generate consent page url
var url = oauth2Client.generateAuthUrl({
access_type: 'offline', // will return a refresh token
scope: 'https://www.googleapis.com/auth/calendar',
approval_prompt: 'force'
});
Most helpful comment
This can be achieved like so: