module AngularRailsCsrf::Concern

Public Instance Methods

verified_request?() click to toggle source
Calls superclass method
# File lib/angular_rails_csrf/concern.rb, line 23
def verified_request?
  super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])
end

Private Instance Methods

forgery_protection_enabled?() click to toggle source
# File lib/angular_rails_csrf/concern.rb, line 50
def forgery_protection_enabled?
  defined?(protect_against_forgery?) &&
    protect_against_forgery? &&
    !respond_to?(:__exclude_xsrf_token_cookie?)
end
option_from(config, option, default = nil) click to toggle source

Fetches the given option from config If the option is not set, return a default value

# File lib/angular_rails_csrf/concern.rb, line 44
def option_from(config, option, default = nil)
  return default if config.nil?

  config.respond_to?(option) ? config.send(option) : default
end