normalize a null proxy default_role to none

/config drops null fields, so the settings form filled in viewer for a null default_role while /auth denied those users. The config now stores a null default_role as none, which the API returns and the widget shows, and the unreachable null branch in the widget is removed.
This commit is contained in:
Josh Hawkins
2026-11-23 09:53:35 -06:00
parent 47fcb90893
commit f0e76645ea
3 changed files with 7 additions and 11 deletions
@@ -29,13 +29,7 @@ export function DefaultRoleWidget(props: WidgetProps) {
return [...BUILT_IN_ROLES, ...custom, NONE_ROLE];
}, [formContext]);
// A null default denies access, so it displays as none
const selectedValue =
value === null
? NONE_ROLE
: typeof value === "string" && value
? value
: "viewer";
const selectedValue = typeof value === "string" && value ? value : "viewer";
const getLabel = (role: string) =>
BUILT_IN_ROLES.includes(role) || role === NONE_ROLE