Skip to content

Force account chooser on social sign-in (prompt=select_account)#19

Merged
oliverhuangcode merged 1 commit into
mainfrom
force-account-chooser
Jul 17, 2026
Merged

Force account chooser on social sign-in (prompt=select_account)#19
oliverhuangcode merged 1 commit into
mainfrom
force-account-chooser

Conversation

@oliverhuangcode

Copy link
Copy Markdown
Contributor

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:

  • Already signed in (didn't sign out): no change at all. The shared .monashcoding.com session is reused exactly as today — no re-prompt, no logout, nothing extra to click.
  • Not signed in (signed out / expired / first login): at that one login moment, the provider shows "choose an account" instead of silently auto-picking. No password re-entry if their provider session is still valid — just a one-click account pick.

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 typecheck passes (confirms the option is valid for better-auth ^1.6.9).
  • biome check clean on the changed file.

🤖 Generated with Claude Code

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>
@oliverhuangcode
oliverhuangcode merged commit 61cad93 into main Jul 17, 2026
3 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