Created
July 13, 2014 14:32
-
-
Save fervisa/266f4fd4abf53c271ad9 to your computer and use it in GitHub Desktop.
Handling Rails csrf-token from an Angular app
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
demoApp.config ($httpProvider) -> | |
authToken = $("meta[name=\"csrf-token\"]").attr("content") | |
$httpProvider.defaults.headers.common["X-CSRF-TOKEN"] = authToken |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment