From f7cc8b31913fe25a6a348536292cec00582ee6b5 Mon Sep 17 00:00:00 2001 From: Yutaka Kamei Date: Fri, 29 Sep 2023 11:45:42 +0900 Subject: [PATCH] Move up the notice to the line of `:with` explanation --- .../lib/action_controller/metal/request_forgery_protection.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index bbf0d57ac98..354b1d8eeed 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -129,13 +129,12 @@ module ActionController # :nodoc: # # If you need to add verification to the beginning of the callback chain, use prepend: true. # * :with - Set the method to handle unverified request. + # Note if default_protect_from_forgery is true, Rails call protect_from_forgery with with :exception. # # Built-in unverified request handling methods are: # * :exception - Raises ActionController::InvalidAuthenticityToken exception. # * :reset_session - Resets the session. # * :null_session - Provides an empty session during request but doesn't reset it completely. Used as default if :with option is not specified. - # Note if default_protect_from_forgery is true, Rails call protect_from_forgery with with :exception. - # This might not be intuitive as the method itself treats :with as :null_session by default. # # You can also implement custom strategy classes for unverified request handling: #