From bfaecf131b855673d6fab88ca2815b0dad0b31e4 Mon Sep 17 00:00:00 2001 From: aeyeopsdev Date: Sun, 6 Sep 2026 17:26:11 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=AB=B8=20fix:=20Stop=20OAuth=20Sign-In=20?= =?UTF-8?q?After=20Binding=20Failure=20(#15652)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aeyeopsdev <275853971+aeyeopsdev@users.noreply.github.com> --- .../src/components/Chat/Messages/Content/ToolCall.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/components/Chat/Messages/Content/ToolCall.tsx b/client/src/components/Chat/Messages/Content/ToolCall.tsx index 59278dcf6f..ee14b6971e 100644 --- a/client/src/components/Chat/Messages/Content/ToolCall.tsx +++ b/client/src/components/Chat/Messages/Content/ToolCall.tsx @@ -53,6 +53,7 @@ export default function ToolCall({ runStepDurationMs?: PartMetadata['runStepDurationMs']; }) { const localize = useLocalize(); + const [oauthError, setOAuthError] = useState(null); const autoExpand = useRecoilValue(store.autoExpandTools); const hasOutput = (output?.length ?? 0) > 0; const [showInfo, setShowInfo] = useState(() => autoExpand && hasOutput); @@ -142,6 +143,7 @@ export default function ToolCall({ if (!auth) { return; } + setOAuthError(null); try { if (isMCPToolCall && mcpServerName) { await dataService.bindMCPOAuth(mcpServerName); @@ -150,9 +152,11 @@ export default function ToolCall({ } } catch (e) { logger.error('Failed to bind OAuth CSRF cookie', e); + setOAuthError(localize('com_ui_oauth_error_generic')); + return; } window.open(auth, '_blank', 'noopener,noreferrer'); - }, [auth, isMCPToolCall, mcpServerName, actionId]); + }, [auth, isMCPToolCall, mcpServerName, actionId, localize]); const hasError = (typeof output === 'string' && isError(output)) || runStepStatus === 'failed'; /** @@ -337,6 +341,11 @@ export default function ToolCall({ {localize('com_ui_sign_in_to_domain', { 0: authDomain })} + {oauthError && ( +

+ {oauthError} +

+ )} )}