Google Drive 401 error is not handled
I've enabled Google Drive in Dillinger. I noticed that when saving a document with "Save to Google Drive", the file was not showing up in Google Drive, but Dillinger was showing "Successfully saved to Google Drive".
The network tab in dev tools was showing that the request was, in fact, failing with 401, but Dillinger doesn't seem to handle the error.
POST https://dillinger.io/save/googledrive returns 200 OK, but the response from the server is:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
I have signed into Google with two different Google accounts, let's say Foo and Bar. I've logged onto Chrome with Foo, but I've integrated Dillinger with Bar.
This issue occurs after logging out from Google services and logging back in. The issue can be fixed by unlinking and then linking Drive again.