improve anthropic oauth token caching and authentication handling
publish / publish (push) Has been cancelled

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-06-17 13:23:15 -04:00
parent 1bd6809d36
commit c0f019ff08
5 changed files with 21 additions and 4 deletions
+12 -3
View File
@@ -50,9 +50,18 @@ export namespace Provider {
}
return {
apiKey: "",
headers: {
authorization: `Bearer ${access}`,
"anthropic-beta": "oauth-2025-04-20",
async fetch(input: any, init: any) {
const access = await AuthAnthropic.access()
const headers = {
...init.headers,
authorization: `Bearer ${access}`,
"anthropic-beta": "oauth-2025-04-20",
}
delete headers["x-api-key"]
return fetch(input, {
...init,
headers,
})
},
}
},