From 9499736593674e20536ec294e9a8890717e7894a Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Fri, 18 Dec 2015 14:39:06 -0200 Subject: [PATCH] Remove safeguard against a previously broken `NullSessionHash#reset_session`. This behavior was fixed on https://github.com/rails/rails/pull/12279. --- lib/devise/rails/warden_compat.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/devise/rails/warden_compat.rb b/lib/devise/rails/warden_compat.rb index 79bed409..553e8e44 100644 --- a/lib/devise/rails/warden_compat.rb +++ b/lib/devise/rails/warden_compat.rb @@ -3,17 +3,8 @@ module Warden::Mixins::Common @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 + request.reset_session end def cookies