Browse Source

fix: ensure enterprise url is set properly during auth flow (#19212)

Aiden Cline 3 weeks ago
parent
commit
d500a8432a
2 changed files with 7 additions and 4 deletions
  1. 5 4
      packages/opencode/src/provider/auth.ts
  2. 2 0
      packages/plugin/src/index.ts

+ 5 - 4
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,
           })
         }
       })

+ 2 - 0
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 }
           ))