Fix : Claude OAuth

This commit is contained in:
decolua 2026-03-03 14:46:05 +07:00
parent 38ded5c62f
commit 07d4cdfa7e
7 changed files with 104 additions and 15 deletions

View file

@ -20,7 +20,7 @@ function getOAuthPlatformEnum() {
export const CLAUDE_CONFIG = {
clientId: "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
authorizeUrl: "https://claude.ai/oauth/authorize",
tokenUrl: "https://console.anthropic.com/v1/oauth/token",
tokenUrl: "https://api.anthropic.com/v1/oauth/token",
scopes: ["org:create_api_key", "user:profile", "user:inference"],
codeChallengeMethod: "S256",
};

View file

@ -140,6 +140,7 @@ async function passthrough(req, res, bodyBuffer) {
async function intercept(req, res, bodyBuffer, mappedModel) {
try {
const body = JSON.parse(bodyBuffer.toString());
console.log("🚀 ~ intercept ~ body:", body)
body.model = mappedModel;
const response = await fetch(ROUTER_URL, {