I have the following scenario:
- Rails app with User and Admin devise models, so I have two scopes.
Created on ember app on router:
Router.map(function() { this.route('panel', function() { this.route('login'); this.route('logout'); }); this.route('admin', function() { this.route('login'); this.route('logout'); }); });
I'm using
jj-abrams
branch once my app is Ember 2.0
Both authenticating on /users/sign_in
and /admins/sign_in
I followed steps on https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-devise#server-side-setup and authentication is working.
Ember is hitting the right urls after creating authenticators and adapters, but the problem is that ESA just have one session service. Once user or admin is logged in session.isAuthenticated
is true and I don't know which scopes are logged in.
Which is the best way to proceed:
- Add a
role
on user reply and set on session - Create a new session for admin user