Skip to content

Commit

Permalink
[Fix] 자동 로그아웃 관련하여 누락된 로직 추가
Browse files Browse the repository at this point in the history
- 수정된 자동 로그아웃 로직 관련하여 누락된 로직 (일반 로그인에만 적용하였고, Oauth 로그인 부분은 누락) 보완

Issues #122
  • Loading branch information
novice1993 committed Sep 30, 2023
1 parent a0e534b commit bd65581
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions client/src/page/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,23 @@ const MainPage = () => {
if (autoLogoutSecondAlarm !== null) {
if (currentTime >= parseInt(autoLogoutSecondAlarm) + secondAlarmTime + lastAlarmTime) {
localStorage.removeItem("autoLogoutSecondAlarm");
} else {
const timeGone = currentTime - parseInt(autoLogoutSecondAlarm);
const remainTime = secondAlarmTime - timeGone;
dispatch(setLoginState()); // 로그인 처리
setAutoLogoutAlarm(dispatch, "second", remainTime, lastAlarmTime);
}

const timeGone = currentTime - parseInt(autoLogoutSecondAlarm);
const remainTime = secondAlarmTime - timeGone;
dispatch(setLoginState()); // 로그인 처리
setAutoLogoutAlarm(dispatch, "second", remainTime, lastAlarmTime);
}

if (autoLogoutLastAlarm !== null) {
if (currentTime >= parseInt(autoLogoutLastAlarm) + lastAlarmTime) {
localStorage.removeItem("autoLogoutLastAlarm");
} else {
const timeGone = currentTime - parseInt(autoLogoutLastAlarm);
const remainTime = lastAlarmTime - timeGone;
dispatch(setLoginState()); // 로그인 처리
setAutoLogoutAlarm(dispatch, "last", remainTime);
}

const timeGone = currentTime - parseInt(autoLogoutLastAlarm);
const remainTime = lastAlarmTime - timeGone;
dispatch(setLoginState()); // 로그인 처리
setAutoLogoutAlarm(dispatch, "last", remainTime);
}
}
}, []);
Expand Down

0 comments on commit bd65581

Please sign in to comment.