Skip to content

Commit

Permalink
Use spree_user instead of spree_current_user
Browse files Browse the repository at this point in the history
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 <elia@schito.me>
  • Loading branch information
cpfergus1 and elia committed Sep 30, 2022
1 parent b0158b8 commit fcd8eff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/spree/authentication_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fcd8eff

Please sign in to comment.