-
Notifications
You must be signed in to change notification settings - Fork 11
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
Session: return early if storeUserEmail is not populated #163
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Video explanation: https://www.loom.com/share/f3b0c3e7680e4856ae1c79270f121b53?sid=1c12b537-b82d-4898-920f-dd439316e92c Also added a secondary fix for a token validation issue seen while impersonating. This was observed in the helmethouseprod account, when a custom app called the Storefront Permissions |
Quality Gate passedIssues Measures |
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
A bug has been identified during the Helmet House project, having to do with B2B impersonation.
Part of the issue is that the
vtex_session
cookie has a longer expiration (~5 days) than theVtexidClientAutCookie
(~1 day). Therefore, when returning to the store after 24 hours the user is likely to have an expiredVtexidClientAutCookie
but a non-expired session.If the user had an active B2B impersonation session when they last used the site, when they return their session will become corrupted due to Storefront-Permission's
setProfile
logic which does not expect this scenario. This can cause undesirable side effects; for example in Helmet House's case, the user is in a "half-logged in" state when they should actually be prompted to log in again (the storefront is not meant to be accessible by anonymous users).The existing logic in the Storefront Permissions
setProfile
flow is this:storeUserEmail
in the session inputauthentication
namespacepublic.impersonate
namespace, and if so, look up the email for that userThis PR adjusts the logic like so:
storeUserEmail
in the session inputauthentication
namespacepublic.impersonate
namespace, and if so, look up the email for that userThis correctly results in the user with an expired cookie to be prompted to log in again. Once they've logged in, their impersonation session will continue, and this is fine.
How should this be manually tested?
The new app is linked in https://arthur--helmethouseprod.myvtex.com . Contact me on Slack for user credentials, or I can present a before/after demo of the fix.