diff --git a/app/initializers/ember-cli-rails-addon-csrf.js b/app/initializers/ember-cli-rails-addon-csrf.js index 1d8dcd4..0f2b8d2 100644 --- a/app/initializers/ember-cli-rails-addon-csrf.js +++ b/app/initializers/ember-cli-rails-addon-csrf.js @@ -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); + } }); }, };