Private
dataPrivate
clearMake a post request to the OCAPI /session endpoint to bridge the session.
The HTTP response contains a set-cookie header which sets the dwsid session cookie. This cookie is used on SFRA, and it allows shoppers to navigate between SFRA and this PWA site seamlessly; this is often used to enable hybrid deployment.
(Note: this method is client side only, b/c MRT doesn't support set-cookie header right now)
Private
handleThis method stores the TokenResponse object retrived from SLAS, and store the data in storage.
Private
isA wrapper method for commerce-sdk-isomorphic helper: loginGuestUser.
A wrapper method for commerce-sdk-isomorphic helper: loginRegisteredUserB2C.
A wrapper method for commerce-sdk-isomorphic helper: logout.
This method queues the requests and handles the SLAS token response.
It returns the queue.
The ready function returns a promise that resolves with valid ShopperLogin token response.
When this method is called for the very first time, it initializes the session by following the public client auth flow to get access token for the user. The flow:
This is a wrapper method for ShopperCustomer API registerCustomer endpoint.
Private
setOptional
options: unknownCreates a function that only executes after a session is initialized.
Function that needs to wait until the session is initialized.
Rest
...args: ArgsWrapped function
Creates a function that only executes after a session is initialized.
Rest
...args: ArgsWrapped function
Private
OCAPISessionsURLPrivate
REFRESH_Private
clientPrivate
fetchedPrivate
pendingPrivate
redirectURIPrivate
shopperPrivate
stores
This class is used to handle shopper authentication. It is responsible for initializing shopper session, manage access and refresh tokens on server/browser environments. As well as providing a mechanism to queue network calls before having a valid access token.
Internal