Created
September 9, 2014 15:43
-
-
Save forced-request/a209de2e7eb15f8bee25 to your computer and use it in GitHub Desktop.
Overloading handle_unverified_request to 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
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
# Overload handle_unverified_request to ensure that | |
# exception is raised each time a request does not | |
# pass validation. | |
def handle_unverified_request | |
raise(ActionController::InvalidAuthenticityToken) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment