From 0c48a04619879e5f0f7143979f924098047048cd Mon Sep 17 00:00:00 2001 From: novice1993 Date: Tue, 3 Oct 2023 01:27:02 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EC=9E=90=EB=8F=99=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EB=88=84=EB=9D=BD=EB=90=9C=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 로그아웃 처리 시 로컬 스토리지에 존재하는 토큰 제거하는 코드 추가 (기존 로직에서 누락) Issues #122 --- client/src/page/MainPage.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/page/MainPage.tsx b/client/src/page/MainPage.tsx index 1dff2eb..b21d341 100644 --- a/client/src/page/MainPage.tsx +++ b/client/src/page/MainPage.tsx @@ -141,6 +141,8 @@ const MainPage = () => { if (autoLogoutSecondAlarm !== null) { if (currentTime >= parseInt(autoLogoutSecondAlarm) + secondAlarmTime + lastAlarmTime) { + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshToken"); localStorage.removeItem("autoLogoutSecondAlarm"); } else { const timeGone = currentTime - parseInt(autoLogoutSecondAlarm); @@ -152,6 +154,8 @@ const MainPage = () => { if (autoLogoutLastAlarm !== null) { if (currentTime >= parseInt(autoLogoutLastAlarm) + lastAlarmTime) { + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshToken"); localStorage.removeItem("autoLogoutLastAlarm"); } else { const timeGone = currentTime - parseInt(autoLogoutLastAlarm); @@ -189,6 +193,8 @@ const MainPage = () => { if (autoLogoutSecondAlarm !== null) { if (currentTime >= parseInt(autoLogoutSecondAlarm) + secondAlarmTime + lastAlarmTime) { + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshToken"); localStorage.removeItem("autoLogoutSecondAlarm"); } else { const timeGone = currentTime - parseInt(autoLogoutSecondAlarm); @@ -200,6 +206,8 @@ const MainPage = () => { if (autoLogoutLastAlarm !== null) { if (currentTime >= parseInt(autoLogoutLastAlarm) + lastAlarmTime) { + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshToken"); localStorage.removeItem("autoLogoutLastAlarm"); } else { const timeGone = currentTime - parseInt(autoLogoutLastAlarm); @@ -230,7 +238,7 @@ const MainPage = () => { {/* props전달 */} - + {isOAuthModalOpen && ( handleMenuChange("관심종목")} onHoldingsClick={() => handleMenuChange("보유종목")} />