Skip to content

Commit

Permalink
[Fix] 자동 로그아웃 누락된 부분 추가
Browse files Browse the repository at this point in the history
- 로그아웃 처리 시 로컬 스토리지에 존재하는 토큰 제거하는 코드 추가 (기존 로직에서 누락)

Issues #122
  • Loading branch information
novice1993 committed Oct 2, 2023
1 parent 02348db commit 0c48a04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/page/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -230,7 +238,7 @@ const MainPage = () => {
<CentralChart />
{/* props전달 */}
<StockOrderSection openOAuthModal={openOAuthModal} openProfileModal={openProfileModal} />
<TabContainerPage></TabContainerPage>
<TabContainerPage />
</Main>
{isOAuthModalOpen && (
<OAuthLoginModal onClose={closeOAuthModal} onEmailLoginClick={openEmailLoginModal} onEmailSignupClick={openEmailSignupModal} onWatchListClick={() => handleMenuChange("관심종목")} onHoldingsClick={() => handleMenuChange("보유종목")} />
Expand Down

0 comments on commit 0c48a04

Please sign in to comment.