randomBrainstormer / MMM-GoogleCalendar

Google Calendar for MagicMirror²
MIT License
64 stars 45 forks source link

The API returned an error: Error: invalid_grant #7

Closed daha1989 closed 2 years ago

daha1989 commented 2 years ago

After restarting my Pi the calendar was giving me an error message. I tried troubleshooting with node authorize.js and received the following: The API returned an error: Error: invalid_grant

Any advice for that?

randomBrainstormer commented 2 years ago

Hi @daha1989, invalid_grant usually indicates that the access token is incorrect or invalid. I would try this steps:

  1. Make sure the email used during node authorize.js is the same OR has access to the credentials in Google Cloud.
  2. Completely delete the current token by navigating to the MMM-GoogleCalendar directory and deleting token.json, if you connect to the raspberry through SSH try running rm -rf token.json to delete the token, once deleted run node authorize.js again.
  3. If step 2 doesn't work try creating a new credential and repeating the authorize process.

Let me know how it goes!

daha1989 commented 2 years ago

It worked. Thanks a lot!