Sha256: 4b1887310f40335d176e26cbdad5f40b5c7808a4bfe1c221f00669c8ee2c3bc9

Contents?: true

Size: 537 Bytes

Versions: 19

Compression:

Stored size: 537 Bytes

Contents

module Oxymoron
  module Concern
    extend ActiveSupport::Concern

    included do
      before_filter :set_xsrf_token_cookie
    end

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

    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
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
oxymoron-1.1.7 lib/oxymoron/concern.rb
oxymoron-1.1.6 lib/oxymoron/concern.rb
oxymoron-1.1.5 lib/oxymoron/concern.rb
oxymoron-1.1.4 lib/oxymoron/concern.rb
oxymoron-1.1.3 lib/oxymoron/concern.rb
oxymoron-1.1.2 lib/oxymoron/concern.rb
oxymoron-1.1.1 lib/oxymoron/concern.rb
oxymoron-1.1.0 lib/oxymoron/concern.rb
oxymoron-1.0.10 lib/oxymoron/concern.rb
oxymoron-1.0.9 lib/oxymoron/concern.rb
oxymoron-1.0.8 lib/oxymoron/concern.rb
oxymoron-1.0.7 lib/oxymoron/concern.rb
oxymoron-1.0.6 lib/oxymoron/concern.rb
oxymoron-1.0.5 lib/oxymoron/concern.rb
oxymoron-1.0.4 lib/oxymoron/concern.rb
oxymoron-1.0.3 lib/oxymoron/concern.rb
oxymoron-1.0.2 lib/oxymoron/concern.rb
oxymoron-1.0.1 lib/oxymoron/concern.rb
oxymoron-1.0.0 lib/oxymoron/concern.rb