Procházet zdrojové kódy

ignore: fix type errors

Dax Raad před 8 měsíci
rodič
revize
7050cc0ac3
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      packages/opencode/src/provider/provider.ts

+ 4 - 4
packages/opencode/src/provider/provider.ts

@@ -86,17 +86,17 @@ export namespace Provider {
         options: {
           apiKey: "",
           async fetch(input: any, init: any) {
-            let info = await Auth.get("github-copilot")
+            const info = await Auth.get("github-copilot")
             if (!info || info.type !== "oauth") return
             if (!info.access || info.expires < Date.now()) {
               const tokens = await copilot.access(info.refresh)
               if (!tokens)
                 throw new Error("GitHub Copilot authentication expired")
-              info = {
+              await Auth.set("github-copilot", {
                 type: "oauth",
                 ...tokens,
-              }
-              await Auth.set("github-copilot", info)
+              })
+              info.access = tokens.access
             }
             const headers = {
               ...init.headers,