Sha256: 25adfe7bf0a6cf84a6068d306e9db124ae2ecac362d34c1643524ce5b0410ba7

Contents?: true

Size: 511 Bytes

Versions: 4

Compression:

Stored size: 511 Bytes

Contents

module Notable
  module UnverifiedRequest
    extend ActiveSupport::Concern

    included do
      prepend_before_filter :track_unverified_request
    end

    def track_unverified_request
      if !verified_request?
        expected = form_authenticity_token
        actual = form_authenticity_param || request.headers["X-CSRF-Token"]
        Notable.track "Unverified Request", "#{actual || "nil"} != #{expected}"
      end
    end
  end
end

ActionController::Base.send(:include, Notable::UnverifiedRequest)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
notable-0.1.0 lib/notable/unverified_request.rb
notable-0.0.3 lib/notable/unverified_request.rb
notable-0.0.2 lib/notable/unverified_request.rb
notable-0.0.1 lib/notable/unverified_request.rb