feat: manage multiple sign-in providers from settings

This commit is contained in:
2026-08-03 11:00:25 +01:00
parent 3a626922a5
commit 37f2c1457e
4 changed files with 296 additions and 179 deletions
+7 -30
View File
@@ -190,6 +190,7 @@ export interface Settings {
email: EmailSettings;
secrets: SecretsSettings;
workflow_log_retention_days?: number | null;
local_login_enabled?: boolean;
}
export interface SecretGroupSummary {
@@ -349,21 +350,6 @@ export interface OrgUserInput {
role: Role;
}
export interface OrgOIDCConfig {
issuer?: string;
client_id?: string;
enabled: boolean;
client_secret_set: boolean;
updated_at?: string;
}
export interface OrgOIDCInput {
issuer: string;
client_id: string;
client_secret: string;
enabled: boolean;
}
export interface PublicProvider {
id: string;
name: string;
@@ -507,12 +493,6 @@ export const auth = {
return authRequest<MeResponse>("/auth/me");
},
/** The URL an admin must register with their OIDC provider. */
oidcRedirectUrl(): string {
if (typeof window === "undefined") return "/auth/oidc/callback";
return `${window.location.origin}/auth/oidc/callback`;
},
/** Unauthenticated: what the login page draws itself from. */
providers(): Promise<ProvidersResponse> {
return authRequest<ProvidersResponse>("/auth/providers");
@@ -544,14 +524,6 @@ export const api = {
return request<void>(`/instance/users/${userId}`, { method: "DELETE" });
},
getInstanceOIDC(): Promise<OrgOIDCConfig> {
return request<OrgOIDCConfig>("/instance/oidc");
},
saveInstanceOIDC(input: OrgOIDCInput): Promise<{ saved: boolean }> {
return request<{ saved: boolean }>("/instance/oidc", { method: "PUT", body: JSON.stringify(input) });
},
listAuthPresets(): Promise<AuthPreset[]> {
return request<AuthPreset[]>("/auth/presets");
},
@@ -683,7 +655,12 @@ export const api = {
return request<Settings>("/settings");
},
saveSettings(settings: { alerts: AlertSettings; email: EmailSettings; workflow_log_retention_days?: number | null }): Promise<{ saved: boolean }> {
saveSettings(settings: {
alerts: AlertSettings;
email: EmailSettings;
workflow_log_retention_days?: number | null;
local_login_enabled?: boolean;
}): Promise<{ saved: boolean }> {
return request<{ saved: boolean }>("/settings", {
method: "PUT",
body: JSON.stringify(settings),