Add enforcedAuthType setting (#6564)

This commit is contained in:
christine betts
2025-09-03 15:33:37 -07:00
committed by GitHub
parent 5cc23f0cd8
commit 987f08a619
10 changed files with 194 additions and 18 deletions
+11 -2
View File
@@ -62,7 +62,7 @@ export function AuthDialog({
}
return null;
});
const items = [
let items = [
{
label: 'Login with Google',
value: AuthType.LOGIN_WITH_GOOGLE,
@@ -82,7 +82,13 @@ export function AuthDialog({
{ label: 'Vertex AI', value: AuthType.USE_VERTEX_AI },
];
const initialAuthIndex = items.findIndex((item) => {
if (settings.merged.security?.auth?.enforcedType) {
items = items.filter(
(item) => item.value === settings.merged.security?.auth?.enforcedType,
);
}
let initialAuthIndex = items.findIndex((item) => {
if (settings.merged.security?.auth?.selectedType) {
return item.value === settings.merged.security.auth.selectedType;
}
@@ -100,6 +106,9 @@ export function AuthDialog({
return item.value === AuthType.LOGIN_WITH_GOOGLE;
});
if (settings.merged.security?.auth?.enforcedType) {
initialAuthIndex = 0;
}
const handleAuthSelect = (authMethod: AuthType) => {
const error = validateAuthMethod(authMethod);