lib/devise/rails/warden_compat.rb in devise-2.2.5 vs lib/devise/rails/warden_compat.rb in devise-2.2.6

- old
+ new

@@ -1,12 +1,19 @@ module Warden::Mixins::Common def request @request ||= ActionDispatch::Request.new(env) end - # This is called internally by Warden on logout + NULL_STORE = + defined?(ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash) ? + ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash : nil + def reset_session! - request.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