Reputation: 31
v12.22.8
6.14.15
72.0.0
7.0.4
clientId
, clientSecret
, redirectUri
gmail
service from googleApis
and oAuth2Client
from google-auth-library
packagescloud functions are deployed on GCP
functions 1)
and 2)
are triggered only once
on function 3)
is set the cron job every hour
on function 4)
is set the cron job every day
The whole issue with a little bit of explanation an a bit of code is submitted here: github issue
Upvotes: 1
Views: 249
Reputation: 117281
I can see by the code that you posted on Github that you are using Oauth2 to authorize your users. You are not using service account authentication.
new googleAuth.OAuth2Client({ clientId, clientSecret, redirectUri})
Apps that are in test have their refresh tokens expired after seven days.
To fix it up your application into production.
A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days.
go to google cloud console for your project under the oauth2 consent screen
Upvotes: 1