From 5d2eff4f73963ef05655457e2b665897b40c2e05 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:44:02 +0100 Subject: [PATCH] fix: normalize null fields from unconfigured OIDC response When no OIDC config exists, the backend returns an object with all null fields (via OidcAdminConfigResponse.unconfigured()). Normalize all null values to sensible defaults when loading the form instead of passing nulls through to Input components and .map() calls. Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/pages/Admin/OidcConfigPage.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/src/pages/Admin/OidcConfigPage.tsx b/ui/src/pages/Admin/OidcConfigPage.tsx index 24c22570..dc279b2d 100644 --- a/ui/src/pages/Admin/OidcConfigPage.tsx +++ b/ui/src/pages/Admin/OidcConfigPage.tsx @@ -38,8 +38,17 @@ export default function OidcConfigPage() { const { toast } = useToast(); useEffect(() => { - adminFetch('/oidc') - .then(setForm) + adminFetch & { configured?: boolean }>('/oidc') + .then((data) => setForm({ + enabled: data.enabled ?? false, + autoSignup: data.autoSignup ?? true, + issuerUri: data.issuerUri ?? '', + clientId: data.clientId ?? '', + clientSecret: data.clientSecret ?? '', + rolesClaim: data.rolesClaim ?? 'roles', + displayNameClaim: data.displayNameClaim ?? 'name', + defaultRoles: data.defaultRoles ?? ['VIEWER'], + })) .catch(() => setForm(EMPTY_CONFIG)); }, []);