-
Notifications
You must be signed in to change notification settings - Fork 48
refactor: improve auth handling and type safety in godaddy hooks #1209
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
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-4a30d115-a4ed-4fb6-94c8-a93f2875611d Co-authored-by: Amp <amp@ampcode.com>
- Remove blocking early returns that prevented JWT-only auth flows - Add explicit type generics to all useMutation calls - Simplify auth pattern to match godaddy.ts overload structure - Use direct ternary for jwt vs session auth selection - Remove unnecessary wrapper functions for cleaner code - Let React Query handle error throwing automatically Amp-Thread-ID: https://ampcode.com/threads/T-2469796c-8d8e-4450-be09-b8dfe01f101a Co-authored-by: Amp <amp@ampcode.com>
🦋 Changeset detectedLatest commit: 975459a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ssions Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0 Co-authored-by: Amp <amp@ampcode.com>
- Convert double quotes to single quotes - Standardize indentation (2 spaces) - Apply formatting across React components and utilities Amp-Thread-ID: https://ampcode.com/threads/T-1d878f81-bcc4-4acd-a1d8-11f31b88ecee Co-authored-by: Amp <amp@ampcode.com>
- Return early after clearing mismatched JWT to avoid race condition - Check for missing JWT before cancelled flag to ensure failure is captured - Guard exchangeFailed state updates with cancelled check to prevent updates after unmount Amp-Thread-ID: https://ampcode.com/threads/T-77963656-ab13-4782-b5fb-efcf2be4696a Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-36b2320b-3465-4c05-9b20-dc79416c2e8a Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-d1b8d98c-ded2-42d5-b59b-25e20b4d1f02 Co-authored-by: Amp <amp@ampcode.com>
pbennett1-godaddy
left a comment
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.
tested and everything working on my side for regression
Changes
This PR improves authentication handling and type safety across all godaddy hooks in the React package.
Key Improvements
useMutationcalls for better type inferenceFiles Changed (22)
packages/react/src/components/checkout/packages/react/src/lib/godaddy/godaddy.tspackages/react/src/lib/graphql-with-errors.tspackages/react/src/server.tsexamples/nextjs/packages/react/src/lib/godaddy/server.tsTesting
Related
This refactor ensures consistent authentication patterns across the entire checkout component library.