Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@spidergears
Last active December 22, 2015 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spidergears/6396913 to your computer and use it in GitHub Desktop.
Save spidergears/6396913 to your computer and use it in GitHub Desktop.
def verified_request?
!protect_against_forgery? || request.get? || request.head? ||
form_authenticity_token == params[request_forgery_protection_token] ||
form_authenticity_token == request.headers['X-CSRF-Token']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment