Error 401 handling in simple ember auth


#1

I am building an ember.js application and am hung up on authentication. The json rest backend is rails. Every request is authenticated using a session cookie (warden).

When a user first navigates to the application root rails redirects to a login page. Once the session is authorized the ember.js app is loaded. Once loaded the ember.js app makes requests to the backend using ember-data RESTadapter and the session for authorization.

The problem is the session will expire after a predetermined amount of time. Many times when this happens the ember.js app is still loaded. So all requests to the backend return a 401 {not autorized} response.

so i need to redirect user to the login page and clear the last token from the session so that isauthenticated property becomes false.

I am using ember simple auth 1.0.0. Anybody have a working solution to this problem?