Force account chooser on social sign-in (prompt=select_account)#19
Merged
Conversation
Set prompt=select_account on the Google and Microsoft providers so the account chooser is always shown during the OAuth handshake. People frequently have several accounts signed in (e.g. a personal Gmail alongside their student one), and the provider silently auto-selecting the wrong one is a common cause of a member being told they aren't one downstream. This only affects the OAuth step. An existing MAC session is reused as before — signed-in users are not re-prompted or logged out; the chooser appears only when someone actually logs in (no session yet). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds
prompt: "select_account"to the Google and Microsoft social providers.Why
Several MAC apps (starting with the membership-verification gate) hit a recurring problem: a member is signed into multiple accounts — commonly a personal Gmail alongside their student account — and the provider silently auto-selects the wrong one. Downstream that surfaces as "you're not a member" for someone who genuinely is, because their personal email isn't on the roster.
Forcing the account chooser makes the person consciously pick the right account at login.
Behaviour — important guarantee
This flag only affects the OAuth authorization step, which runs only when there is no active MAC session. So:
.monashcoding.comsession is reused exactly as today — no re-prompt, no logout, nothing extra to click.In other words: SSO still works; users only see the chooser when they're actually logging in.
Scope
This is suite-wide (mac-auth is shared), which is intended — the wrong-account problem isn't specific to one app. Applied to both providers for consistency.
Verification
npm run typecheckpasses (confirms the option is valid for better-auth ^1.6.9).biome checkclean on the changed file.🤖 Generated with Claude Code