From b4df85085faf840161b563f1c841d1bbf4b9b0f0 Mon Sep 17 00:00:00 2001 From: Sungu Kim <108677235+haegu97@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:39:49 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F[Refactor]=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EB=A7=8C=EB=A3=8C=20=EC=8B=9C=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EC=B4=88=EA=B8=B0=ED=99=94=20#148?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/authStore.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store/authStore.ts b/src/store/authStore.ts index 21cf2dd6..a70256d4 100644 --- a/src/store/authStore.ts +++ b/src/store/authStore.ts @@ -24,7 +24,10 @@ export const useAuthStore = create()( checkLoginStatus: () => { const token = getCookie('auth_token'); set((state) => { - return { ...state, isLoggedIn: !!token }; + if (!token) { + return { ...state, isLoggedIn: false, user: null }; + } + return { ...state, isLoggedIn: true }; }); }, }),