Module: Warden::Mixins::Common

Defined in:
lib/devise/rails/warden_compat.rb

Constant Summary collapse

NULL_STORE =

Deprecate: Remove this check once we move to Rails 4 only.

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

Instance Method Summary collapse

Instance Method Details

#cookiesObject



19
20
21
# File 'lib/devise/rails/warden_compat.rb', line 19

def cookies
  request.cookie_jar
end

#requestObject



2
3
4
# File 'lib/devise/rails/warden_compat.rb', line 2

def request
  @request ||= ActionDispatch::Request.new(env)
end

#reset_session!Object



11
12
13
14
15
16
17
# File 'lib/devise/rails/warden_compat.rb', line 11

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