We replaced the method #redirect_back_or_default and the class user_last_url_storer because Devise already provides functionality similar to redirect_back_or_default. After emerging PR#228 We noticed that the redirects were not working as intended and investigated the cause. We found a couple of issues that we missed and needed to be rectified, specifically:
We need to Authenticate the user and not rely on authorization
Utilize spree_user instead of spree_current_user since that is the scope being utilized
Use implemented custom paths instead of devise helpers for certain routes
How Has This Been Tested?
The current test suite covers the changes made in the PR - quadrupled checked 👍
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
Fixes the new store location feature introduced in https://github.com/solidusio/solidus_auth_devise/pull/228
Motivation and Context
We replaced the method #redirect_back_or_default and the class user_last_url_storer because Devise already provides functionality similar to redirect_back_or_default. After emerging PR#228 We noticed that the redirects were not working as intended and investigated the cause. We found a couple of issues that we missed and needed to be rectified, specifically:
We need to Authenticate the user and not rely on authorization Utilize
spree_user
instead ofspree_current_user
since that is the scope being utilized Use implemented custom paths instead of devise helpers for certain routesHow Has This Been Tested?
The current test suite covers the changes made in the PR - quadrupled checked 👍
Types of changes
New feature (non-breaking change which adds functionality)Breaking change (fix or feature that would cause existing functionality to not work as expected)Checklist: