1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/rails/warden_compat.rb
2013-08-05 11:47:36 +02:00

22 lines
673 B
Ruby

module Warden::Mixins::Common
def request
@request ||= ActionDispatch::Request.new(env)
end
# Deprecate: Remove this check once we move to Rails 4 only.
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