Closed theodorton closed 10 years ago
Looked over the patch and it looks like a good idea to switch over to using the Evented class. Just give me a day or two to think about if there are any changes or additional features to add to the patch before merging.
Cool :) I started experimenting with returning a promise from .authorize
as well, which I quess would be more typical for ember. May be a good fit for this patch.
Just a few minor notes in the code to use the strict comparison operators. Once those are set I'll merge the patch then I will update the README with a little more detail about the api changes to the callbacks.
I took the liberty of cleaning up the jshint grunt tasks (they should've captured the missing strict comparison operators in the first place).
Looks ok?
Everything looks good. Thanks for cleaning up the jshint grunt task. I'll merge the changes later tonight. Cheers.
Instead of directly defining the
onRedirect
,onSuccess
andonError
callbacks directly on the object, this pull request extends theEmber.OAuth2
object withEmber.Evented
so that one can define more callbacks, and be more specific.Ember.Evented
has support foron
,one
andoff
, this library can now use this.It should maintain backward compatibility with the previous syntax, but will log deprecation notices to the console when detected.