mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
fix: correct API key empty validation logic
The condition '!apiKey.trim() && apiKey.length > 1' was always false because if apiKey.trim() is falsy (empty string), then apiKey.length is 0, which is not greater than 1. The fix simplifies the check to just '!apiKey.trim()' to properly validate that the API key is not empty or whitespace-only.
This commit is contained in:
parent
0179726222
commit
df120d0f5c
1 changed files with 2 additions and 4 deletions
|
|
@ -873,10 +873,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|||
async (apiKey: string) => {
|
||||
try {
|
||||
onAuthError(null);
|
||||
if (!apiKey.trim() && apiKey.length > 1) {
|
||||
onAuthError(
|
||||
'API key cannot be empty string with length greater than 1.',
|
||||
);
|
||||
if (!apiKey.trim()) {
|
||||
onAuthError('API key cannot be empty.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue