Skip to content
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

@W-15200182@ PWA Kit V2 Hybrid session handling - WIP #1745

Draft
wants to merge 3 commits into
base: release-2.8.x
Choose a base branch
from

Conversation

vcua-mobify
Copy link
Contributor

@vcua-mobify vcua-mobify commented Apr 11, 2024

This PR ports the approach taken in #1696 to reduce the amount of sessions that are churned as a shopper navigates between PWA v2 and SFRA.

These changes require the plugin_slas changes added in https://github.com/SalesforceCommerceCloud/plugin_slas/pull/187 to work

DONE
Single tab cases

  • no more constantly regenerating the dwsid as a shopper jumps between SFRA/PWA
    a benefit of this is the tracking consent form no longer appears on each PWA -> SFRA transition since the user selection is remembered because we've kept the same dwsid
  • logging in on PWA / SFRA logs you in on the other (ie. log in via SFRA checkout logs you into PWA also)
  • logging out of one system logs you out of the other

Multi tab cases

  • handle login on multi tab - a log in on one tab should log you in on other tabs
  • handling logout on multi tab - a log out on one tab should log you out of other tabs
  • updating PWA headers on multi tab auth change

TODO
Multi tab cases

  • Make the update snappier. It should happen in the background rather than when user hovers over the header
  • CSRF token errors on SFRA forms when session changes

AKA - we need a v2 version of #1703 to handle re-rendering PWA if SFRA changes the access token (which is in cookie store not local store)

Notes:
On SFRA, login state updates once the tab navigates to a new page. If a form is on the current SFRA page, we cannot do anything about that form's CSRF token being invalidated by a session change in a different tab.

  • The main affected forms are the tracking consent form and checkout when a PWA login occurs
  • Persisting the same DWSID through login is probably the way to keep these forms valid.

@vcua-mobify vcua-mobify changed the base branch from develop to release-2.8.x April 12, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant