summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useAuthCommand.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-06-25 15:38:18 -0700
committerGitHub <[email protected]>2025-06-25 22:38:18 +0000
commit79c647d486a5ef3cf9eb68f23000525e8d2c4a91 (patch)
tree43dab16125247ef844b8b46a403935356f98f4cd /packages/cli/src/ui/hooks/useAuthCommand.ts
parent00b24c917e6c6f5e059fec6cb0a5b55789fa1e1e (diff)
Merge "Login with Google Workspace" auth option into "Login with Google" (#1574)
Co-authored-by: Scott Densmore <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/useAuthCommand.ts')
-rw-r--r--packages/cli/src/ui/hooks/useAuthCommand.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/cli/src/ui/hooks/useAuthCommand.ts b/packages/cli/src/ui/hooks/useAuthCommand.ts
index 445b184b..283572d2 100644
--- a/packages/cli/src/ui/hooks/useAuthCommand.ts
+++ b/packages/cli/src/ui/hooks/useAuthCommand.ts
@@ -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 {