From ebc38e187c73edea247aedf1b353476f92d9b45c Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 25 Mar 2026 23:37:28 -0500 Subject: [PATCH] fix: ensure enterprise url is set properly during auth flow --- packages/opencode/src/provider/auth.ts | 9 +++++---- packages/plugin/src/index.ts | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/provider/auth.ts b/packages/opencode/src/provider/auth.ts index 759f8803ae86..fc4cc5e6b9c0 100644 --- a/packages/opencode/src/provider/auth.ts +++ b/packages/opencode/src/provider/auth.ts @@ -215,12 +215,13 @@ export namespace ProviderAuth { } if ("refresh" in result) { + const { type: _, provider: __, refresh, access, expires, ...extra } = result yield* auth.set(input.providerID, { type: "oauth", - access: result.access, - refresh: result.refresh, - expires: result.expires, - ...(result.accountId ? { accountId: result.accountId } : {}), + access, + refresh, + expires, + ...extra, }) } }) diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index 7e5ae7a6ec56..8bdb51a2aec4 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -129,6 +129,7 @@ export type AuthOuathResult = { url: string; instructions: string } & ( access: string expires: number accountId?: string + enterpriseUrl?: string } | { key: string } )) @@ -149,6 +150,7 @@ export type AuthOuathResult = { url: string; instructions: string } & ( access: string expires: number accountId?: string + enterpriseUrl?: string } | { key: string } ))