Class: ActionController::RequestForgeryProtection::ProtectionMethods::NullSession
- Inherits:
-
Object
- Object
- ActionController::RequestForgeryProtection::ProtectionMethods::NullSession
- Defined in:
- lib/action_controller/metal/request_forgery_protection.rb
Defined Under Namespace
Classes: NullCookieJar, NullSessionHash
Instance Method Summary collapse
-
#handle_unverified_request ⇒ Object
This is the method that defines the application behavior when a request is found to be unverified.
-
#initialize(controller) ⇒ NullSession
constructor
A new instance of NullSession.
Constructor Details
#initialize(controller) ⇒ NullSession
Returns a new instance of NullSession.
164 165 166 |
# File 'lib/action_controller/metal/request_forgery_protection.rb', line 164 def initialize(controller) @controller = controller end |
Instance Method Details
#handle_unverified_request ⇒ Object
This is the method that defines the application behavior when a request is found to be unverified.
169 170 171 172 173 174 175 |
# File 'lib/action_controller/metal/request_forgery_protection.rb', line 169 def handle_unverified_request request = @controller.request request.session = NullSessionHash.new(request) request.flash = nil request. = { skip: true } request. = NullCookieJar.build(request, {}) end |