Last active
April 18, 2017 23:46
-
-
Save forced-request/2385c25519cfbbbd47be to your computer and use it in GitHub Desktop.
protect_from_forgery
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
def protect_from_forgery(options = {}) | |
self.request_forgery_protection_token ||= :authenticity_token | |
prepend_before_filter :verify_authenticity_token, options | |
end | |
def verify_authenticity_token | |
unless verified_request? | |
logger.warn "WARNING: Can't verify CSRF token authenticity" if logger | |
handle_unverified_request | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment