philbooth · GitHub

Fixes #30.

The core functionality of this repo isn't asynchronous, so there's no reason to return a promise. And because promises ripple outwards, returning a promise has led to some ugly code in the auth server, where we expose the result on the request object. Everywhere we use it has to do this:

request.app.geo.then(geoData => {
  // use geoData...
});

It would be much nicer if we could just use request.app.geo directly, hence this PR.

Obviously, ditching promises is a breaking change to the API, so I've included a major version bump. And CI has been updated to run on node 6 and 8, too.

This PR also includes the test fix from #31, so I'll close that one and we can just bring the fix in here instead.

@mozilla/fxa-devs r?

Read the original on github.com ↗