fix: improve error message when OAuth succeeds but project ID is required (#21070)

This commit is contained in:
nityam
2026-03-05 00:58:34 +05:30
committed by GitHub
parent ac4e65d669
commit 8f36051f32
5 changed files with 61 additions and 1 deletions
+7
View File
@@ -80,6 +80,7 @@ import {
type ConsentRequestPayload,
type AgentsDiscoveredPayload,
ChangeAuthRequestedError,
ProjectIdRequiredError,
CoreToolCallStatus,
generateSteeringAckMessage,
buildUserSteeringHintPrompt,
@@ -771,6 +772,12 @@ export const AppContainer = (props: AppContainerProps) => {
if (e instanceof ChangeAuthRequestedError) {
return;
}
if (e instanceof ProjectIdRequiredError) {
// OAuth succeeded but account setup requires project ID
// Show the error message directly without "Failed to authenticate" prefix
onAuthError(getErrorMessage(e));
return;
}
onAuthError(
`Failed to authenticate: ${e instanceof Error ? e.message : String(e)}`,
);