You may refer to this document to read more information about refresh token expiration. Since you mentioned that the refresh token expires after 7 days, then it appears that the scenario below is happening at your end.
"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." As you set the publishing status to "Testing" so the refresh token expires every 7 days and receives an “invalid_grant” error. That being said, please go to the Google API Console and navigate to the OAuth consent screen and then change the publishing status to “In production” to avoid the refresh token expiring in 7 days. Let me know if you have any question.
Thanks,
|
||||||