Skip to content

Commit

Permalink
feat: 로그아웃 버튼 클릭시 로컬스토리지에서 jwt 토큰 삭제 및 페이지 리로드
Browse files Browse the repository at this point in the history
  • Loading branch information
YearaChoi committed Aug 3, 2024
1 parent 826da09 commit e9eee26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/Common/HeaderLightVer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ function HeaderLightVer() {
navigate("/sign");
};

const handleSignOutBtnClick = () => {};
const handleSignOutBtnClick = () => {
localStorage.removeItem("jwtToken");
window.location.reload();
navigate("/");
};

return (
<Wrapper>
Expand Down
5 changes: 4 additions & 1 deletion src/components/MainPage/HeaderMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ function HeaderMain() {
navigate("/sign");
};

const handleSignOutBtnClick = () => {};
const handleSignOutBtnClick = () => {
localStorage.removeItem("jwtToken");
window.location.reload();
};

useEffect(() => {
document.body.style.overflow = isLoginModalOpen ? "hidden" : "auto";
Expand Down

0 comments on commit e9eee26

Please sign in to comment.