9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/crystal_ext/protect_from_forgery.rb', line 9
def call
if config.session?
request = workspace.request.must_be.defined
params = workspace.params.must_be.defined
token = request.session['authenticity_token'] || params['session_authenticity_token']
if token.blank? and request.get? and
token = generate_authenticity_token
request.session['authenticity_token'] = token
end
workspace.session_authenticity_token = token
end
next_processor.call
end
|