-
-
Save arthurschreiber/99635 to your computer and use it in GitHub Desktop.
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
# Remove the CSRF Check for Ajax Requests. | |
module ActionController | |
module RequestForgeryProtection | |
def verified_request? | |
!protect_against_forgery? || | |
request.method == :get || | |
request.xhr? || | |
!verifiable_request_format? || | |
form_authenticity_token == params[request_forgery_protection_token] | |
end | |
protected :verified_request? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment