Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add storefront private token header #962

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

mllemango
Copy link
Contributor

@mllemango mllemango commented Aug 9, 2023

Reverts #961

Adding an extra flag to specify the use of the private token
Adding a warning line to anyone who has both a private and public token
This hopefully avoids any issues that may be caused by the new working private token headers

@mllemango mllemango requested a review from a team as a code owner August 9, 2023 20:46
lib/base-types.ts Outdated Show resolved Hide resolved
lib/clients/graphql/storefront_client.ts Outdated Show resolved Hide resolved

if (this.storefrontAccessToken && privateToken) {
logger(this.storefrontClass().config).warning(
'You have both private and public storefront access tokens. The private token will be used.',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging here instead of earlier at validateConfig because the config params doesn't include the public access token at that point. I could do a blanket log.info at the earlier stage but I feel like that's a little bit spammy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - this shouldn't be a super common case but it's nice to nudge folks to fix it!

@mllemango mllemango changed the title Add storefront private token header and flag Add storefront private token header Aug 10, 2023

if (this.storefrontAccessToken && privateToken) {
logger(this.storefrontClass().config).warning(
'You have both private and public storefront access tokens. The private token will be used.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - this shouldn't be a super common case but it's nice to nudge folks to fix it!

@mllemango mllemango merged commit 44c80bc into main Aug 10, 2023
13 checks passed
@mllemango mllemango deleted the revert-961-revert-959-add-storefront-missing-headers branch August 10, 2023 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants