feat(auth): let admins keep the login page on OIDC-only instances (#2925)

A new app setting oidc_auto_redirect (default on) is part of the admin form
and the public app config. Off, an instance without password login no longer
sends visitors straight to the IdP: the login page shows its SSO button,
also while the cached config is read. Admin toggle on desktop and phone.
This commit is contained in:
Maurice
2026-11-13 09:35:18 +01:00
parent d5d9428cf2
commit 924b4e0787
45 changed files with 227 additions and 8 deletions
@@ -45,6 +45,7 @@ describe('the derived key lists', () => {
'password_registration',
'oidc_login',
'oidc_registration',
'oidc_auto_redirect',
'passkey_login',
'webauthn_rp_id',
'webauthn_origins',
@@ -82,6 +83,7 @@ describe('the derived key lists', () => {
'places_details_enabled',
'places_enrich_enabled',
'place_shadow_enabled',
'oidc_auto_redirect',
].sort(),
);
});
@@ -815,6 +815,15 @@ describe('getAppConfig', () => {
vi.unstubAllEnvs();
});
it('AUTH-DB-052d: oidc_auto_redirect stays on until an admin stores false (#2925)', async () => {
createUser(testDb);
expect((await svc.getAppConfig(null)).oidc_auto_redirect).toBe(true);
await appSetting('oidc_auto_redirect', 'false');
expect((await svc.getAppConfig(null)).oidc_auto_redirect).toBe(false);
await appSetting('oidc_auto_redirect', 'true');
expect((await svc.getAppConfig(null)).oidc_auto_redirect).toBe(true);
});
it('AUTH-DB-052b: managed is false unless the install says otherwise', async () => {
createUser(testDb);
expect((await svc.getAppConfig(null)).managed).toBe(false);