You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: improve auth handling and type safety in godaddy hooks (#1209)
* Add auth context and update API calls to use authentication
Amp-Thread-ID: https://ampcode.com/threads/T-4a30d115-a4ed-4fb6-94c8-a93f2875611d
Co-authored-by: Amp <amp@ampcode.com>
* refactor: improve auth handling and type safety in godaddy hooks
- 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>
* Fix JWT session scoping to prevent reuse across different checkout sessions
Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0
Co-authored-by: Amp <amp@ampcode.com>
* Add legacy flow fallback when JWT exchange fails
Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0
Co-authored-by: Amp <amp@ampcode.com>
* Fix JWT type to use undefined instead of null for consistency
Amp-Thread-ID: https://ampcode.com/threads/T-65c39e0f-21b4-4900-a6a6-35c262cb3ec0
Co-authored-by: Amp <amp@ampcode.com>
* chore: format code with consistent style
- 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>
* fix: handle exchangeFailed state correctly when token exchange fails
- 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>
* Fix the draft order query
* Format
* Format changes
* update types
* use GODADDY_API_HOST to derive all env states
* remove unused getEnvVar import
* fix: set isLoading to false when JWT already exists for session
Amp-Thread-ID: https://ampcode.com/threads/T-36b2320b-3465-4c05-9b20-dc79416c2e8a
Co-authored-by: Amp <amp@ampcode.com>
* update fulfillment logic for delivery method
* Add sessionId to confirmCheckout auth overload
Amp-Thread-ID: https://ampcode.com/threads/T-d1b8d98c-ded2-42d5-b59b-25e20b4d1f02
Co-authored-by: Amp <amp@ampcode.com>
* add back redirect if order not found
* Format files
* Update order of accessing session
* fix create session input types and fix delivery method logic
* add appearance data to checkout session query
* modify viewable sections
* add changeset for version change
---------
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Phil Bennett <pbennett1@godaddy.com>
0 commit comments