Module: Oxymoron::Concern

Extended by:
ActiveSupport::Concern
Defined in:
lib/oxymoron/concern.rb

Instance Method Summary collapse

Instance Method Details



9
10
11
# File 'lib/oxymoron/concern.rb', line 9

def set_xsrf_token_cookie
  cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end

#verified_request?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'lib/oxymoron/concern.rb', line 13

def verified_request?
  if respond_to?(:valid_authenticity_token?, true)
    super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])
  else
    super || form_authenticity_token == request.headers['X-XSRF-TOKEN']
  end
end