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

feat(react-centra-checkout): add support for passing token details to useCentraOrders #80

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Thomas0c
Copy link
Contributor

@Thomas0c Thomas0c commented Nov 4, 2022

Experiencing that initial call to useCentraOrders returns 403 (access denied) given that the api-token header is not set unless one or more other calls have been made prior. Thus allowing for passing a token name and reading this, when calling useCentraOrders to avoid this.

Similarly also checking if returned token does not correspond with the initial - and if so updating the token cookie.

@vercel
Copy link

vercel bot commented Nov 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
centra-types-docs ✅ Ready (Inspect) Visit Preview Nov 4, 2022 at 6:25PM (UTC)
react-centra-checkout-docs ✅ Ready (Inspect) Visit Preview Nov 4, 2022 at 6:25PM (UTC)

@vercel vercel bot temporarily deployed to Preview – centra-types-docs November 4, 2022 11:53 Inactive
@vercel vercel bot temporarily deployed to Preview – react-centra-checkout-docs November 4, 2022 11:54 Inactive
@vercel vercel bot temporarily deployed to Preview – centra-types-docs November 4, 2022 13:40 Inactive
@vercel vercel bot temporarily deployed to Preview – react-centra-checkout-docs November 4, 2022 13:40 Inactive
@vercel vercel bot temporarily deployed to Preview – react-centra-checkout-docs November 4, 2022 13:44 Inactive
@vercel vercel bot temporarily deployed to Preview – centra-types-docs November 4, 2022 13:45 Inactive
@vercel vercel bot temporarily deployed to Preview – centra-types-docs November 4, 2022 18:25 Inactive
@vercel vercel bot temporarily deployed to Preview – react-centra-checkout-docs November 4, 2022 18:25 Inactive
@Thomas0c Thomas0c changed the title Add support for passing tokenName to useCentraOrders Add support for passing token details to useCentraOrders Nov 7, 2022
@Thomas0c Thomas0c marked this pull request as ready for review November 7, 2022 07:58
@adamsoderstrom adamsoderstrom added the bug Something isn't working label Aug 15, 2024
Comment on lines +646 to +650
token?: {
tokenName?: string
tokenExpires?: number | Date
tokenCookieOptions?: Cookies.CookieAttributes
},
Copy link
Member

Choose a reason for hiding this comment

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

question: Is this necessary?
suggestion: Would be nice if we can enforce that tokenName in both the Context as well as inside useCentraOrders.

@maeertin maeertin changed the title Add support for passing token details to useCentraOrders feat(react-centra-checkout): add support for passing token details to useCentraOrders Aug 16, 2024
@maeertin maeertin marked this pull request as draft October 23, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants