-
Notifications
You must be signed in to change notification settings - Fork 39
fix(headless-ssr): fix setAccessToken for ssr commerce
#6181
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
|
| import {buildLogger} from '../../../app/logger.js'; | ||
| import {stateKey} from '../../../app/state-key.js'; | ||
| import type {Controller} from '../../../controllers/controller/headless-controller.js'; | ||
| import {loadConfigurationActions} from '../../../features/commerce/configuration/configuration-actions-loader.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use alias ?
| const mockCallback = vi.fn(); | ||
| tokenManager.registerCallback(mockCallback); | ||
|
|
||
| // Should only receive the latest token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after comments : )
Enhanced access token management now supports dynamic token updates at any point in the SSR workflow, eliminating previous timing constraints.
setAccessTokenhad to be called before any engine was created (e.g., before fetching the static state). Calling it afterward (e.g. at post-hydration) would not propagate the change to already created controllers.https://coveord.atlassian.net/browse/KIT-5113