refactor: improve auth handling and type safety in godaddy hooks#1209
Merged
wcole1-godaddy merged 24 commits intomainfrom Nov 10, 2025
Merged
refactor: improve auth handling and type safety in godaddy hooks#1209wcole1-godaddy merged 24 commits intomainfrom
wcole1-godaddy merged 24 commits intomainfrom
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
approved these changes
Nov 7, 2025
Collaborator
pbennett1-godaddy
left a comment
There was a problem hiding this comment.
tested and everything working on my side for regression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.