simplabs/ember-simple-auth — pull request #125 by timothycommoner (2014-04-03 22:25:46+00:00)
Title: Update Authenticator and Add Authorizer for Devise

Copied from pull request [here](https://github.com/simplabs/ember-simple-auth/pull/107#issuecomment-39485062):

Pull updated. One thing to note, though: while most of the update is to the Devise package, I did have to make a single change to the core package. Specifically, I set the login_controller_mixin to get the remember_me property, if it's available. This solution doesn't seem ideal, though, as each package might pollute the mixin a little more. Still, I couldn't think of a better solution, save perhaps declaring the mixin from within the Devise package. Any suggestions?

I've also got a question about the way the authenticator's restore function works. Ideally, we'll use promises (and this pull request takes that approach), but I've run into an issue with this approach. Specifically, if the user reloads on a route that needs access to the current_user, such as a page that displays a list of the current user's posts, then the route will assume that there is no current_user since the promise hasn't resolved yet. I tried forcing this in a before_model function, but basically ran into the same problem.

In my app, I just decided to go with a standard async: false request, forcing the user to authenticate before getting the route's model. I assume there's a better approach to this problem, and perhaps one that I can bake into the package. Any ideas?