fix: remove redundant vscode.env.openExternal call during login flow

The login flow had two browser-opening mechanisms firing simultaneously:
1. The backend's authenticateWithDeviceAuthTUI() opens the browser via the
   'open' npm package during authorize()
2. handleLogin() called vscode.env.openExternal() which shows a VS Code
   trust dialog AND opens a second browser tab

The trust dialog from vscode.env.openExternal() persisted after the user
completed authentication in the browser, since nothing dismissed it.

Remove the vscode.env.openExternal() call. The backend already opens the
browser, and the DeviceAuthCard webview provides an 'Open Browser' button
as a user-initiated fallback.

Closes #7026
This commit is contained in:
kiloconnect[bot]
2026-03-13 15:12:54 +00:00
parent 8ff7f2d029
commit 876959f84b
+5 -2
View File
@@ -1713,8 +1713,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
const codeMatch = auth.instructions?.match(/code:\s*(\S+)/i)
const code = codeMatch ? codeMatch[1] : undefined
// Step 2: Open browser for user to authorize
vscode.env.openExternal(vscode.Uri.parse(auth.url))
// The backend already opens the browser via the `open` npm package during
// authorize(). Calling vscode.env.openExternal() here would show a VS Code
// trust dialog that persists after the user completes authentication in the
// browser, and would open a second browser tab. The DeviceAuthCard webview
// provides an "Open Browser" button as a user-initiated fallback.
// Send device auth details to webview
this.postMessage({