Reputation: 220
I'm writing a program that uses the google calendar api, so I used the quick start from here and it worked. but recently the same code stopped working and gave me the following error.
The API returned an error: Error: invalid_grant
This means that the error came from
103: calendar.events.list()
What could cause this problem and how can I fix it?
Upvotes: 4
Views: 2588
Reputation: 51
This happened to me when I changed my account password. To fix it I had to delete the credentials file that gets referenced in the quick start here:
var SCOPES = ['https://www.googleapis.com/auth/calendar.readonly'];
TOKEN_DIR = (process.env.HOME || process.env.HOMEPATH ||
process.env.USERPROFILE) + '/.credentials/';
var TOKEN_PATH = TOKEN_DIR + 'drive-nodejs-quickstart.json';
This should do the trick.
rm /Users/<username>/.credentials/drive-nodejs-quickstart.json
Upvotes: 5