I'm using Ember 1.8.1, Ember Data 1.0.0-beta.12, Handlebars 1.3.0, jQuery 1.11.1, Ember Simple Auth 0.7.2 and Ember Simple Auth Devise 0.7.2 for my frontend. My backend is backed with Rails, Grape and Devise.
Now I'm trying to build a simple authentication. Login works great: Ember app sends login credentials to my Rails API and gets an access token back. Tokens are written to the localStorage and reloading the page works fine. But as far as I understand Ember Simple Auth (see this demo), all future AJAX requests will be executed with this token as Authorization
header - but that's not the case.
Do I have to setup an ajaxPrefilter
by myself or should Ember Simple Auth do that for me and there is some bug in my code/Ember Simple Auth?
Update 1
I just played around with some console.log
debugging. It seems that the authorize
function don't get fired. All other functions could be logged successfully, except authorize
.
Update 2
Issue resolved: just forgot to set crossOriginWhitelist.