-
-
Save shafi-shaikat/6c58cc0618d1e1439bcbb04c5722c862 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