Search code examples
ember.jsember-simple-auth

bast way to handle server session reset with ember simple auth


I am using the ember simple auth. i really like it as it have taken care alot of stuff I need. However I am wondering if there is a good pattern to deal with the situation when the serverside reset the session but sesssion.isAuthenticated saying is still valid.

I am using a custom authenticator and authorizer (just FYI). In my usecase I like to able to hook into a modal poping up for signin when serverside have expired. There are a few ways to go about it I suppose but I am wondering if there are better practices out there.


Solution

  • When the server invalidates the session the next time the Ember app makes a request it should receive a 401 response which would trigger automatic invalidation of the Ember Simp,e Auth session. Ember Simple Auth will also invoke the authorizationFailed action on the application route when you use the ApplicationRouteMixin.