Last active
September 26, 2017 17:24
-
-
Save dunmaksim/991f534c9318c3fef650d87927a7350c to your computer and use it in GitHub Desktop.
Dojo Toolkit with CSRF Token from cookies at any request
This file contains hidden or 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
require([ | |
"dojo/request/notify", | |
"dojo/cookie", | |
"dojo/domReady!" | |
], function (notify, cookie) { | |
notify("send", function (response, cancel) { | |
response.xhr.setRequestHeader('X-CSRFToken', cookie("csrftoken")); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment