Skip to content

Instantly share code, notes, and snippets.

@keathley
Created May 10, 2014 17:43
Show Gist options
  • Save keathley/fdca3ae1ec1d93b57049 to your computer and use it in GitHub Desktop.
Save keathley/fdca3ae1ec1d93b57049 to your computer and use it in GitHub Desktop.
csrf headers for angular
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