Skip to content

Fix OAuth popup sign-in flow - #8

Merged
Keegan-Vaz merged 1 commit into
mainfrom
temp-deployment
Sep 7, 2026
Merged

Fix OAuth popup sign-in flow#8
Keegan-Vaz merged 1 commit into
mainfrom
temp-deployment

Conversation

@Keegan-Vaz

Copy link
Copy Markdown
Collaborator

Better Auth's popup flow drops the token in top-level popups because the session cookie never arrives cross-site. This adds a custom OAuth popup helper that opens the sign-in flow, waits for the returned token, stores it under the key Better Auth's bearer helpers already read, and reloads the app so the session hook rehydrates. SignInPage now uses this helper instead of authClient.signIn.popup and performs a full navigation to avoid stale signed-out state.

Better Auth's popup flow drops the token in top-level popups because the session cookie never arrives cross-site. This adds a custom OAuth popup helper that opens the sign-in flow, waits for the returned token, stores it under the key Better Auth's bearer helpers already read, and reloads the app so the session hook rehydrates. SignInPage now uses this helper instead of authClient.signIn.popup and performs a full navigation to avoid stale signed-out state.
@Keegan-Vaz
Keegan-Vaz merged commit 35823d6 into main Sep 7, 2026
1 of 2 checks passed
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