Skip to content

Commit

Permalink
Forking w/ rondale-sc#35
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Bloomfield committed Nov 21, 2018
1 parent c747ab2 commit d731902
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/initializers/ember-cli-rails-addon-csrf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export default {

initialize() {
$.ajaxPrefilter((options, originalOptions, xhr) => {
const token = $('meta[name="csrf-token"]').attr('content');
xhr.setRequestHeader('X-CSRF-Token', token);
if (!options.crossDomain) {
const token = $('meta[name="csrf-token"]').attr('content');
xhr.setRequestHeader('X-CSRF-Token', token);
}
});
},
};

0 comments on commit d731902

Please sign in to comment.