Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ describe('buildGenericOAuthConfigs', () => {
expect(cfgs[0].disableSignUp).toBe(false)
})

it('requests the broadly-supported prompt=login, not the OIDC-optional select_account', async () => {
const cfgs = await buildGenericOAuthConfigs({
providers: [
{
id: 'idp_abc',
registrationId: 'sso',
enabled: true,
autoCreateUsers: true,
discoveryUrl: 'https://x/.well-known/openid-configuration',
},
] as any,
creds: async () => ({ clientId: 'c', clientSecret: 's' }),
tierAllowsOidc: true,
})
expect(cfgs[0].prompt).toBe('login')
})

it('skips disabled providers and providers without credentials', async () => {
const cfgs = await buildGenericOAuthConfigs({
providers: [
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/server/auth/build-oauth-configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export async function buildGenericOAuthConfigs({
pkce: true,
// Force the account picker so an admin typing a specific email isn't
// silently signed in as whoever the IdP already has a session for.
prompt: 'select_account',
prompt: 'login',
// Better-Auth's JIT block. When false, the OAuth callback aborts in
// handleOAuthUserInfo before any user/session is created. Existing
// users still link via accountLinking.trustedProviders.
Expand Down