instance method
valid_per_form_csrf_token?
Ruby on Rails 6.0.6
Since v5.2.8.1 PrivateSignature
valid_per_form_csrf_token?(token, session)
No documentation comment.
Parameters
-
tokenreq -
sessionreq
Source
# File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 385
def valid_per_form_csrf_token?(token, session) # :doc:
if per_form_csrf_tokens
correct_token = per_form_csrf_token(
session,
normalize_action_path(request.fullpath),
request.request_method
)
ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, correct_token)
else
false
end
end
Defined in actionpack/lib/action_controller/metal/request_forgery_protection.rb line 385
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RequestForgeryProtection