Using urlencoded params for refresh/auth tokens
This commit is contained in:
parent
4201b31a24
commit
c3ece186a4
1 changed files with 4 additions and 4 deletions
|
|
@ -86,9 +86,9 @@ export async function handleOAuthCallback(
|
||||||
const response = await fetch(metadata.token_endpoint, {
|
const response = await fetch(metadata.token_endpoint, {
|
||||||
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",
|
||||||
code,
|
code,
|
||||||
code_verifier: codeVerifier,
|
code_verifier: codeVerifier,
|
||||||
|
|
@ -117,9 +117,9 @@ export async function refreshAccessToken(
|
||||||
const response = await fetch(metadata.token_endpoint, {
|
const response = await fetch(metadata.token_endpoint, {
|
||||||
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: "refresh_token",
|
grant_type: "refresh_token",
|
||||||
refresh_token: refreshToken,
|
refresh_token: refreshToken,
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue