From 06445d4d037f392c0fa3e6c5c69150edb7b6b08b Mon Sep 17 00:00:00 2001 From: afds4567 <33995840+afds4567@users.noreply.github.com> Date: Wed, 20 Sep 2023 01:08:18 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EC=9E=AC=EB=B0=9C=EA=B8=89=EC=8B=9C?= =?UTF-8?q?=20=EB=B0=9B=EC=9D=80=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20(#449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/getApi.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/apis/getApi.ts b/frontend/src/apis/getApi.ts index a0c45529..91652585 100644 --- a/frontend/src/apis/getApi.ts +++ b/frontend/src/apis/getApi.ts @@ -29,10 +29,9 @@ async function refreshToken(headers: Headers): Promise { throw new Error('Failed to refresh access token.'); } - console.log('refreshResponse', refreshResponse); - console.log('refreshResponse.text()', refreshResponse.text()); // 새로운 엑세스 토큰을 반환합니다. - return await refreshResponse.text(); + const responseBody = await refreshResponse.json(); + return responseBody.accessToken; } catch (error) { // 네트워크 요청 실패 또는 예외 발생 시 예외를 캐치하여 처리합니다. console.error('네트워크 요청 실패 또는 예외 발생:', error); @@ -57,6 +56,7 @@ async function withTokenRefresh(callback: () => Promise): Promise { console.log(`Authorization : Bearer ${userToken}`); //새로운 토큰 재발급 userToken = await refreshToken(headers); + console.log('L59 userToken', userToken); localStorage.setItem('userToken', userToken); console.log('localStorage에 새로운 토큰 적용 성공!');