From 093f9b958093ef1e45781b79200c3b41839f8d91 Mon Sep 17 00:00:00 2001 From: Connor Ferguson <68167430+cpfergus1@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:04:55 -0600 Subject: [PATCH] Use spree_user instead of spree_current_user Devise utilizes spree_user scope when executing after_sign_in_path. This is an important distinction when storing the user location as the user would not be redirected as expected if we use spree_current_user. Co-Authored-By: Elia Schito --- lib/spree/authentication_helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spree/authentication_helpers.rb b/lib/spree/authentication_helpers.rb index 93b6051e..cda58643 100644 --- a/lib/spree/authentication_helpers.rb +++ b/lib/spree/authentication_helpers.rb @@ -42,11 +42,11 @@ def storable_spree_user_location? end def store_spree_user_location! - store_location_for(:spree_current_user, request.fullpath) + store_location_for(:spree_user, request.fullpath) end def stored_spree_user_location_or(fallback_location) - stored_location_for(:spree_current_user) || fallback_location + stored_location_for(:spree_user) || fallback_location end end end