percolatestudio / meteor-google-api

A simple API encapsulating some common patterns regarding Google's APIs
https://atmospherejs.com/percolate/google-api
MIT License
48 stars 30 forks source link

500 error on exchangeRefreshToken #43

Closed nickbreaton closed 6 years ago

nickbreaton commented 6 years ago

I understand most people have probably moved passed using this package at this point, so I am just documenting a workaround for this issue.

exchangeRefreshToken will result in the error:

'exchangeRefreshToken': Unable to exchange google refresh token.

Meteor used to have Meteor.http available, but it is now in the http package, however the library is still depending on former.

To fix this install http with:

meteor add http

and then add the following to your application entry point:

import { HTTP } from 'meteor/http'

Meteor.http = HTTP
danopia commented 6 years ago

This was a bit cryptic to debug, the fake 500 took me for a little ride. Do you happen to know which meteor version removed the old API?

It looks like meteor-google-api uses the proper API HTTP.call in google-api-async.js, so the older Meteor.http.call usage in google-api-methods.js is inconsistent. I'm using this patch to bring it in line: https://github.com/danopia/meteor-google-api/commit/75e17afcedd04887063f034674cb95ae52b861a4