Created
May 10, 2014 17:43
-
-
Save keathley/fdca3ae1ec1d93b57049 to your computer and use it in GitHub Desktop.
csrf headers for angular
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
angular.module('app', []) | |
.config(['$httpProvider', ($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