The refres_token is retrieved only the first time the app is approved in the google account.
If the user has approved the app on multiple computers, the second computer won't receive the refres_token (I guess).
Solution:
Conditionally add prompt: 'consent' to const authorizeUrl = oAuth2Client.generateAuthUrl({ access_type: 'offline', scope: GSheetHandler.scopes, }); when the local client hasn't ever been authenticated
The refres_token is retrieved only the first time the app is approved in the google account. If the user has approved the app on multiple computers, the second computer won't receive the refres_token (I guess).
Solution:
Conditionally add
prompt: 'consent'
toconst authorizeUrl = oAuth2Client.generateAuthUrl({ access_type: 'offline', scope: GSheetHandler.scopes, });
when the local client hasn't ever been authenticated