Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
Why does my google OAuth2 refresh_token expire after a week?

I am currently creating a simple website using JS. In my application, I am using nodemailer as a tool so that individuals can contact me. The contact form goes directly to my email once the user submits the form.

I am using https//mail.google.com API with oAuth2 authentication (using refresh_token and accessToken). When I first began using oAuth2, it began working right away. However, “invalid_grant” has appeared in my console after submitting the form on the condition that the refresh_token I use have been living for a week. The token does work for the first 7 days but then expires by saying it’s an “invalid_grant” and that the “token has been revoked”.

How might I resolve this problem? (I’ll reply to any additional problems you have about this question)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!