Skip to content

fix(checkout): trigger auth modal on auto-open for unauthenticated users - #136

Open
Hsu-Pei-Chun wants to merge 2 commits into
masterfrom
fix/fix-checkout-modal-auth-on-auto-open
Open

fix(checkout): trigger auth modal on auto-open for unauthenticated users#136
Hsu-Pei-Chun wants to merge 2 commits into
masterfrom
fix/fix-checkout-modal-auth-on-auto-open

Conversation

@Hsu-Pei-Chun

Copy link
Copy Markdown
Contributor

When checkoutProductId URL param matches, the useEffect called onOpen() directly. But for unauthenticated users the component returns early without rendering the modal, so nothing happened. Now it checks auth state first and calls onAuthRequired() callback instead, allowing the consumer to show the login modal.

trello card : https://trello.com/c/xb4DSA1r

@Logos50607
Logos50607 force-pushed the master branch 4 times, most recently from dc2cb64 to 807ea30 Compare April 10, 2026 03:51
Hsu-Pei-Chun and others added 2 commits April 10, 2026 11:55
When checkoutProductId URL param matches, the useEffect called onOpen()
directly. But for unauthenticated users the component returns early
without rendering the modal, so nothing happened. Now it checks auth
state first and calls onAuthRequired() callback instead, allowing the
consumer to show the login modal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… from staying true

When fetchCurrentGeolocation or the refresh-token API request fails
(e.g. network error, DNS not resolved), the error was unhandled and
setIsAuthenticating(false) was never called. This caused isAuthenticating
to stay true permanently, blocking any logic that waits for auth to
settle (like the checkoutProductId auto-open flow).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Logos50607
Logos50607 force-pushed the fix/fix-checkout-modal-auth-on-auto-open branch from 5e54332 to a490e11 Compare April 10, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant