mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-03 00:14:28 -07:00
feat(auth): improve API key authentication flow (#11760)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -119,6 +119,10 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
if (authType === AuthType.USE_GEMINI) {
|
||||
setAuthState(AuthState.AwaitingApiKeyInput);
|
||||
return;
|
||||
}
|
||||
setAuthState(AuthState.Unauthenticated);
|
||||
},
|
||||
[settings, config, setAuthState],
|
||||
@@ -157,50 +161,52 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
return (
|
||||
<Box
|
||||
borderStyle="round"
|
||||
borderColor={theme.border.default}
|
||||
flexDirection="column"
|
||||
borderColor={theme.border.focused}
|
||||
flexDirection="row"
|
||||
padding={1}
|
||||
width="100%"
|
||||
alignItems="flex-start"
|
||||
>
|
||||
<Text bold color={theme.text.primary}>
|
||||
Get started
|
||||
</Text>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.primary}>
|
||||
How would you like to authenticate for this project?
|
||||
<Text color={theme.text.accent}>? </Text>
|
||||
<Box flexDirection="column" flexGrow={1}>
|
||||
<Text bold color={theme.text.primary}>
|
||||
Get started
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<RadioButtonSelect
|
||||
items={items}
|
||||
initialIndex={initialAuthIndex}
|
||||
onSelect={handleAuthSelect}
|
||||
onHighlight={() => {
|
||||
onAuthError(null);
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
{authError && (
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.status.error}>{authError}</Text>
|
||||
<Text color={theme.text.primary}>
|
||||
How would you like to authenticate for this project?
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<RadioButtonSelect
|
||||
items={items}
|
||||
initialIndex={initialAuthIndex}
|
||||
onSelect={handleAuthSelect}
|
||||
onHighlight={() => {
|
||||
onAuthError(null);
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
{authError && (
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.status.error}>{authError}</Text>
|
||||
</Box>
|
||||
)}
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.secondary}>(Use Enter to select)</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.primary}>
|
||||
Terms of Services and Privacy Notice for Gemini CLI
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.link}>
|
||||
{
|
||||
'https://github.com/google-gemini/gemini-cli/blob/main/docs/tos-privacy.md'
|
||||
}
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.secondary}>
|
||||
(Use Enter to select, Esc to close)
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.primary}>
|
||||
Terms of Services and Privacy Notice for Gemini CLI
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.link}>
|
||||
{
|
||||
'https://github.com/google-gemini/gemini-cli/blob/main/docs/tos-privacy.md'
|
||||
}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user