Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forgery protection in master #1000

Closed
lighthouse-import opened this issue May 16, 2011 · 1 comment
Closed

forgery protection in master #1000

lighthouse-import opened this issue May 16, 2011 · 1 comment

Comments

@lighthouse-import
Copy link

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6674
Created by Anton Topchii - 2011-04-05 20:58:29 UTC

Current forgery protection is not raise any exceptions as said in documentation. It just quietly reset session. And request processing goes to controller action.

CSRF protection is turned on with the protect_from_forgery method,

which will check the token and raise an ActionController::InvalidAuthenticityToken

if it doesn't match what was expected. A call to this method is generated for new

\Rails applications by default. You can customize the error message by editing

public/422.html.

  def verify_authenticity_token
    verified_request? || handle_unverified_request
  end

  def handle_unverified_request
    reset_session
  end
@vijaydev
Copy link
Member

A warning had been added recently: 59705de

@josevalim This can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants