Checkout Session Syncing Solutions
In a previous release, we improved our GraphQL Authentication implementation which added the ability for a shopper to login from their Catalyst/headless storefront and remain logged in as they proceed into the Stencil checkout page.
This document outlines step-by-step instructions to further improve that feature which allow the shopper to login (and logout) from the Stencil checkout page, and have their login state persist back to the Catalyst/headless storefront.
Intended Behavior
Login Flow
- The shopper navigates to Stencil Checkout as a guest.
- They click Sign In.
- They’re redirected to the login page on the Catalyst/headless storefront.
- After signing in, they’re redirected back to Stencil Checkout, now signed in.
Logout Flow
- The shopper navigates to Stencil Checkout while signed in.
- They click Sign Out.
- They’re redirected to the logout route on the Catalyst/headless storefront.
- After signing out, they’re redirected back to Stencil Checkout, now as a guest.
Setup Instructions
-
Use the latest Catalyst code.
Ensure you’ve merged the following pull requests:
-
Configure login and logout routes.
Send a request to GET a Channel Site to retrieve the
site_idfor your Catalyst/headless storefront.Send a request to PUT Routes to configure the login and logout routes.
-
Enable storefront redirection in checkout settings.
To enable storefront redirection in checkout settings, send a request to PUT Checkout Settings to update the
should_redirect_to_storefront_for_authsetting.