instance method
real_csrf_token
Ruby on Rails edge
Since v5.2.8.1 Private — implementation detail, not part of the public APISignature
real_csrf_token(_session = nil)
No documentation comment.
Parameters
-
_sessionopt = nil
Source
# File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 810
def real_csrf_token(_session = nil) # :doc:
csrf_token = request.env.fetch(CSRF_TOKEN) do
request.env[CSRF_TOKEN] = csrf_token_storage_strategy.fetch(request) || generate_csrf_token
end
# Decoded once per token rather than once per read: a page asks for
# the real token once per form it renders.
if @_real_csrf_token_source == csrf_token
@_real_csrf_token
else
@_real_csrf_token_source = csrf_token
@_real_csrf_token = decode_csrf_token(csrf_token)
end
end
Defined in actionpack/lib/action_controller/metal/request_forgery_protection.rb line 810
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RequestForgeryProtection