CSRF in meta tag
joshpfosi opened this issue · 4 comments
joshpfosi commented
Hi, I'm trying to use the below code
App.ApplicationAdapter = DS.ActiveModelAdapter.extend({
headers: Ember.computed(function(){
var token = Ember.$('meta[name="csrf-token"]').attr('content');
return {"X-CSRF-Token": token};
})
});
but in my Ember app, the csrf token is not defined in a meta tag I suppose? Bottom line is token
is always undefined. Still learning here, but I followed the README exactly (no extra steps). What steps must I take to embed this into html?
I have an ember-cli / rails backend set up.
krzkrzkrz commented
@joshpfosi manage to solve this? I am on the same boat
joshpfosi commented
No! I tabled it since this issue, but cannot solve it!
abuiles commented
@joshpfosi @krzkrzkrz at the moment there is no option to configure that, you can easily copy this and customize it to your own app :).