Last active
October 5, 2017 12:35
-
-
Save skwp/f0d09dc9adac07e597bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import getCookie from 'cookie'; | |
export default { | |
name: "csrf", | |
initialize: function() { | |
Ember.$.ajaxPrefilter(function(options, originalOptions, xhr) { | |
var token = getCookie("X-CSRF-TOKEN"); | |
xhr.setRequestHeader("X-CSRF-Token", token); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment