amkirwan / ember-oauth2

JavaScript library for using OAuth 2.0 Implicit Grant flow (Client-Side Flow) with Ember.js
MIT License
133 stars 22 forks source link

Make authorize function return a Ember.RSVP.Promise #9

Closed theodorton closed 10 years ago

theodorton commented 10 years ago

The promise will either resolve or reject based on the authorization attempt.

Should be backwards compatible as the authorize function didn't have any return value before, but for coffeescript users, there may be some issues with implicit returns when the function is called from a model hook in an Ember.Route.

theodorton commented 10 years ago

Proposed minor version bump (see README edit)

amkirwan commented 10 years ago

Thanks for the pull request. I went ahead and made some changes so that the promise could resolve or reject correctly for testing. I also updated the tests to use jasmine 2.0.