From 9663453972ee9d40d783f2bc098498aa4266571e Mon Sep 17 00:00:00 2001 From: afds4567 <33995840+afds4567@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:50:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20refreshToken=EC=9D=84=20=EC=9E=AC?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=ED=95=A0=EB=95=8C=20body=EC=97=90=20accessTo?= =?UTF-8?q?ken=EC=9D=84=20=EC=B6=94=EA=B0=80=20(#438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/getApi.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/apis/getApi.ts b/frontend/src/apis/getApi.ts index 8980e143..83bc0f8b 100644 --- a/frontend/src/apis/getApi.ts +++ b/frontend/src/apis/getApi.ts @@ -13,9 +13,13 @@ async function refreshToken(headers: Headers): Promise { const refreshResponse = await fetch(`${DEFAULT_PROD_URL}/refresh-token`, { method: 'POST', headers, + body: JSON.stringify({ + accessToken: localStorage.getItem('userToken'), + }), }); if (!refreshResponse.ok) { + console.log('refreshResponse.ok하지 못함'); throw new Error('Failed to refresh access token.'); } console.log('refreshResponse', refreshResponse); @@ -78,7 +82,7 @@ export const getApi = async (url: string) => { } const responseData: T = await response.json(); - + console.log('responseData L84까지 성공', responseData); return responseData; }); };