fix: correct API key validation logic in handleApiKeySubmit (#25453)

Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
Martin
2026-04-30 06:06:14 +08:00
committed by GitHub
parent 2194da2b02
commit d6ce310901
+2 -4
View File
@@ -875,10 +875,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 or whitespace only.');
return;
}