mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-15 07:04:45 +00:00
fix claude auth
This commit is contained in:
parent
89b705194b
commit
8502a190f8
1 changed files with 6 additions and 6 deletions
|
|
@ -55,15 +55,15 @@ export async function loginAnthropic(
|
||||||
const tokenResponse = await fetch(TOKEN_URL, {
|
const tokenResponse = await fetch(TOKEN_URL, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: new URLSearchParams({
|
||||||
grant_type: "authorization_code",
|
grant_type: "authorization_code",
|
||||||
client_id: CLIENT_ID,
|
client_id: CLIENT_ID,
|
||||||
code: code,
|
code: code ?? "",
|
||||||
state: state,
|
|
||||||
redirect_uri: REDIRECT_URI,
|
redirect_uri: REDIRECT_URI,
|
||||||
code_verifier: verifier,
|
code_verifier: verifier,
|
||||||
|
...(state ? { state } : {}),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -97,8 +97,8 @@ export async function refreshAnthropicToken(
|
||||||
): Promise<OAuthCredentials> {
|
): Promise<OAuthCredentials> {
|
||||||
const response = await fetch(TOKEN_URL, {
|
const response = await fetch(TOKEN_URL, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
body: JSON.stringify({
|
body: new URLSearchParams({
|
||||||
grant_type: "refresh_token",
|
grant_type: "refresh_token",
|
||||||
client_id: CLIENT_ID,
|
client_id: CLIENT_ID,
|
||||||
refresh_token: refreshToken,
|
refresh_token: refreshToken,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue