Skip to content

Commit

Permalink
Fix : remove user info in local storage #83
Browse files Browse the repository at this point in the history
- correct the icon src
- remove user info every time user revisit after automatic loggout

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>
  • Loading branch information
bentshrimp committed Oct 5, 2023
1 parent 8d305de commit 050c481
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/Logo.svg" />
<link rel="icon" href="%PUBLIC_URL%/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand Down
8 changes: 7 additions & 1 deletion src/pages/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ function MainPage() {
const setIsLogin = useSetRecoilState(isLogin);

const checkIsLogin = async () => {
setIsLogin(await checkTokenValid());
const loggedIn = await checkTokenValid();
if (loggedIn) {
localStorage.removeItem("id");
localStorage.removeItem("name");
localStorage.removeItem("avatar");
}
setIsLogin(loggedIn);
};

useEffect(() => {
Expand Down

0 comments on commit 050c481

Please sign in to comment.