Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions auth/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,23 @@ export const auth = betterAuth({
},

socialProviders: {
// `prompt: "select_account"` forces the provider's account chooser during the
// OAuth handshake so people with several signed-in accounts (e.g. a personal
// Gmail alongside their student one) consciously pick the right one, rather
// than the provider silently auto-selecting the wrong account. This only
// affects the OAuth step itself — it does NOT run when an existing MAC session
// is reused, so signed-in users are not re-prompted or logged out.
google: {
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
prompt: "select_account",
},
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID as string,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET as string,
// "common" so personal Microsoft accounts (Hotmail/Outlook/Live) work too.
tenantId: "common",
prompt: "select_account",
},
},

Expand Down
Loading