mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 02:07:24 +00:00
ignore: fix type errors
This commit is contained in:
parent
4d3d63294d
commit
7050cc0ac3
1 changed files with 4 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue