From a1e18dfde99bbd3c29dea49a9f0c0d33755647dd Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Thu, 2 Feb 2023 20:28:15 +0000 Subject: [PATCH] fix: json is the past --- .../lib/score-import/import-types/common/api-kai/reauth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/lib/score-import/import-types/common/api-kai/reauth.ts b/server/src/lib/score-import/import-types/common/api-kai/reauth.ts index d981a0f2e..a92d99e19 100644 --- a/server/src/lib/score-import/import-types/common/api-kai/reauth.ts +++ b/server/src/lib/score-import/import-types/common/api-kai/reauth.ts @@ -39,14 +39,14 @@ export function CreateKaiReauthFunction( const url = `${KaiTypeToBaseURL(kaiType)}/oauth/token`; res = await fetch(url, { - body: JSON.stringify({ + body: new URLSearchParams({ refresh_token: authDoc.refreshToken, grant_type: "refresh_token", client_secret: CLIENT_SECRET, client_id: CLIENT_ID, - }), + }).toString(), method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { "Content-Type": "application/x-www-form-urlencoded" }, }); } catch (err) { logger.error(`Unexpected error while fetching reauth?`, { res, err });