mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 04:24:51 -07:00
fix: improve error message when OAuth succeeds but project ID is required (#21070)
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
getErrorMessage,
|
||||
ValidationRequiredError,
|
||||
isAccountSuspendedError,
|
||||
ProjectIdRequiredError,
|
||||
} from '@google/gemini-cli-core';
|
||||
|
||||
import type { AccountSuspensionInfo } from '../ui/contexts/UIStateContext.js';
|
||||
@@ -54,6 +55,14 @@ export async function performInitialAuth(
|
||||
},
|
||||
};
|
||||
}
|
||||
if (e instanceof ProjectIdRequiredError) {
|
||||
// OAuth succeeded but account setup requires project ID
|
||||
// Show the error message directly without "Failed to login" prefix
|
||||
return {
|
||||
authError: getErrorMessage(e),
|
||||
accountSuspensionInfo: null,
|
||||
};
|
||||
}
|
||||
return {
|
||||
authError: `Failed to login. Message: ${getErrorMessage(e)}`,
|
||||
accountSuspensionInfo: null,
|
||||
|
||||
Reference in New Issue
Block a user