Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember Simple Auth: Session lost on refresh

I'm using Ember Simple Auth Devise v 0.6.4 in an Ember-cli app.

I can log in fine but when I refresh the page the session is lost. (Tested in Firefox and Chrome.)

Right after logging in, inspecting the localStorage shows the session and after refreshing localStorage is empty.

Here's what's in the local storage when I sign in:

enter image description here

like image 569
niftygrifty Avatar asked Aug 09 '14 03:08

niftygrifty


1 Answers

The problem is that you have neither user_token nor user_email in the session which are required for the session to be authenticated. So as soon as you reload the page the authenticator's restore method rejects the session. Also without user_token and user_email the authorizer is not going to actually authorize any requests.

You'll need to change your server side devise setup as described here.

like image 86
marcoow Avatar answered Oct 10 '22 11:10

marcoow