-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh Page on Sign-In / Refresh Page & Redirect back to Storefront on Sign-Out #442
Conversation
I opened a new PR on a new branch - addressed all comments from previous PR. With Christophe's help, I added a couple unit tests & integration tests but the integration tests actually required making a PR to the WCM core components so I took them out for now. |
Codecov Report
@@ Coverage Diff @@
## master #442 +/- ##
============================================
- Coverage 85.30% 85.28% -0.02%
- Complexity 1087 1089 +2
============================================
Files 221 221
Lines 5519 5533 +14
Branches 800 802 +2
============================================
+ Hits 4708 4719 +11
- Misses 658 659 +1
- Partials 153 155 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Looks good. Just as you mentioned, tests are missing. |
Unit test added now :) |
Description
For Signing Out :
I added the baseUrl(Storefront URL) in the App configs, and in the event handler for signing out, we redirect the user to the main storefront once they click 'Sign Out'.
The baseUrl is configured based on the main storefront url(Storefront can be any language/country, not always US and English), and implemented in StoreConfigExporter.
For Signing In :
Added a simple refresh after all the sign-in flow is complete.
Related Issue
adobe/aem-cif-guides-venia#59
Motivation and Context
If users are in any admin pages(Address book, account management), once they sign out we want them to be redirected back to the main storefront. Currently, we revoke the user token and reset cookies as well as the contexts, but no refresh/redirect takes place.
How Has This Been Tested?
This has been tested in the two sign out user cases.
Signing out from the main navigation. Once we click 'sign out', no matter which page we're in(Catalog, address book, etc), we're redirected back to the storefront.
Same thing happens when signing out from the account panel in responsive mode.
Also tested in the core components examples page as well.
Screenshots (if appropriate):
Types of changes
Checklist: