mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Merge "Login with Google Workspace" auth option into "Login with Google" (#1574)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
This commit is contained in:
committed by
GitHub
parent
00b24c917e
commit
79c647d486
@@ -29,32 +29,15 @@ export function AuthDialog({
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(
|
||||
initialErrorMessage || null,
|
||||
);
|
||||
const allAuthItems = [
|
||||
const items = [
|
||||
{
|
||||
label: 'Login with Google',
|
||||
value: AuthType.LOGIN_WITH_GOOGLE_PERSONAL,
|
||||
},
|
||||
{ label: 'Gemini API Key', value: AuthType.USE_GEMINI },
|
||||
{
|
||||
label: 'Login with Google (for Workspace or licensed Code Assist users)',
|
||||
value: AuthType.LOGIN_WITH_GOOGLE_ENTERPRISE,
|
||||
},
|
||||
{ label: 'Vertex AI', value: AuthType.USE_VERTEX_AI },
|
||||
];
|
||||
|
||||
const isSelectedAuthInMore = allAuthItems
|
||||
.slice(2)
|
||||
.some((item) => item.value === settings.merged.selectedAuthType);
|
||||
|
||||
const [showAll, setShowAll] = useState(isSelectedAuthInMore);
|
||||
|
||||
const initialAuthItems = [
|
||||
...allAuthItems.slice(0, 2),
|
||||
{ label: 'More...', value: 'more' },
|
||||
];
|
||||
|
||||
const items = showAll ? allAuthItems : initialAuthItems;
|
||||
|
||||
let initialAuthIndex = items.findIndex(
|
||||
(item) => item.value === settings.merged.selectedAuthType,
|
||||
);
|
||||
@@ -64,10 +47,6 @@ export function AuthDialog({
|
||||
}
|
||||
|
||||
const handleAuthSelect = (authMethod: string) => {
|
||||
if (authMethod === 'more') {
|
||||
setShowAll(true);
|
||||
return;
|
||||
}
|
||||
const error = validateAuthMethod(authMethod);
|
||||
if (error) {
|
||||
setErrorMessage(error);
|
||||
|
||||
Reference in New Issue
Block a user