Skip to content

Commit 01fb104

Browse files
christsoclaude
andcommitted
fix: restore accidentally deleted comment
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 88a3615 commit 01fb104

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/opencode/src/mcp/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export namespace MCP {
226226
{
227227
onRedirect: async (url) => {
228228
log.info("oauth redirect requested", { key, url: url.toString() })
229+
// Store the URL - actual browser opening is handled by startAuth
229230
},
230231
},
231232
actualPort,
@@ -284,7 +285,7 @@ export namespace MCP {
284285
duration: 8000,
285286
}).catch((e) => log.debug("failed to show toast", { error: e }))
286287
} else {
287-
// Normal auth needed
288+
// Store transport for later finishAuth call
288289
pendingOAuthTransports.set(key, transport)
289290
status = { status: "needs_auth" as const }
290291
// Show toast for needs_auth
@@ -551,8 +552,8 @@ export namespace MCP {
551552
// If we get here, we're already authenticated
552553
return { authorizationUrl: "" }
553554
} catch (error) {
554-
// Normal auth flow
555555
if (error instanceof UnauthorizedError && capturedUrl) {
556+
// Store transport for finishAuth
556557
pendingOAuthTransports.set(mcpName, transport)
557558
return { authorizationUrl: capturedUrl.toString() }
558559
}

0 commit comments

Comments
 (0)