Sha256: b65f30bb8d605bd00790934e8683909a930d66865900e798f7bd30d3fab50547

Contents?: true

Size: 610 Bytes

Versions: 6

Compression:

Stored size: 610 Bytes

Contents

module Warden::Mixins::Common
  def request
    @request ||= ActionDispatch::Request.new(env)
  end

  NULL_STORE =
    defined?(ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash) ?
      ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash : nil

  def reset_session!
    # Calling reset_session on NULL_STORE causes it fail.
    # This is a bug that needs to be fixed in Rails.
    unless NULL_STORE && request.session.is_a?(NULL_STORE)
      request.reset_session
    end
  end

  def cookies
    request.cookie_jar
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise-3.0.4 lib/devise/rails/warden_compat.rb
devise-2.2.8 lib/devise/rails/warden_compat.rb
devise-2.2.7 lib/devise/rails/warden_compat.rb
devise-3.0.3 lib/devise/rails/warden_compat.rb
devise-2.2.6 lib/devise/rails/warden_compat.rb
devise-3.0.2 lib/devise/rails/warden_compat.rb