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:
Tommaso Sciortino
2025-06-25 15:38:18 -07:00
committed by GitHub
parent 00b24c917e
commit 79c647d486
13 changed files with 31 additions and 95 deletions

View File

@@ -46,12 +46,16 @@ export const useAuthCommand = (
config,
);
} catch (e) {
const errorMessage =
let errorMessage = `Failed to login.\nMessage: ${getErrorMessage(e)}`;
if (
settings.merged.selectedAuthType ===
AuthType.LOGIN_WITH_GOOGLE_PERSONAL
? `Failed to login. Ensure the Google account you are using is not a Workspace account and that you are not a licensed Code Assist user (see https://goo.gle/gemini-cli-auth-docs#workspace-gca).
Message: ${getErrorMessage(e)}`
: `Failed to login. Message: ${getErrorMessage(e)}`;
AuthType.LOGIN_WITH_GOOGLE_PERSONAL &&
!process.env.GOOGLE_CLOUD_PROJECT
) {
errorMessage =
'Failed to login. Workspace accounts and licensed Code Assist users must configure' +
` GOOGLE_CLOUD_PROJECT (see https://goo.gle/gemini-cli-auth-docs#workspace-gca).\nMessage: ${getErrorMessage(e)}`;
}
setAuthError(errorMessage);
openAuthDialog();
} finally {

View File

@@ -1043,7 +1043,7 @@ describe('useGeminiStream', () => {
it('should call parseAndFormatApiError with the correct authType on stream initialization failure', async () => {
// 1. Setup
const mockError = new Error('Rate limit exceeded');
const mockAuthType = AuthType.LOGIN_WITH_GOOGLE_ENTERPRISE;
const mockAuthType = AuthType.LOGIN_WITH_GOOGLE_PERSONAL;
mockParseAndFormatApiError.mockClear();
mockSendMessageStream.mockReturnValue(
(async function* () {