node-google-apps-script
node-google-apps-script copied to clipboard
gapps auth command will fail and not show error if call to Oauth.getToken fails
Essentially, I think there's a missing else block around the
credentials.refresh_token = tokens.refresh_token; resolve(credentials);
At auth.js:90.
This masks any issues with communicating with Google (in my case there was a proxy issue). I believe this issue occurs in other places in the project (I deleted my auth and re-authed as I was getting errors running upload/push.
Happy to write and submit a PR.
Hi @AledLewis PRs are welcome if you could provide more specific steps to reproduce I could try this as well.
(couldn't reproduce, this is from memory).
Symptom was Uncaught TypeError: Cannot read property 'refresh_token' of undefined
It was some interaction with my proxy on gapps auth
that caused getToken to fail. It looks like execution continues to attempt to write to credentials with a probably-undefined tokens object. This then causes the promise to exit and mask the reject (I guess).
Here's a PR to show my fix https://github.com/danthareja/node-google-apps-script/pull/76