From 98da59d2050915c20fe502ba04d6022f6cab1370 Mon Sep 17 00:00:00 2001 From: hjy080530 Date: Tue, 3 Mar 2026 15:57:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore(teacher):=20=EC=84=B1=EA=B3=B5?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EC=99=80=20=EC=83=81=EA=B4=80=EC=97=86?= =?UTF-8?q?=EC=9D=B4=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=ED=8A=B8=20?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/useAuthStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stores/useAuthStore.ts b/src/stores/useAuthStore.ts index 21e2088..ad2437c 100644 --- a/src/stores/useAuthStore.ts +++ b/src/stores/useAuthStore.ts @@ -34,6 +34,8 @@ export const useAuthStore = create()( const { accessToken } = useAuthStore.getState(); try { await logoutApi(accessToken); + } catch (error) { + console.error('로그아웃 API 호출 실패:', error); } finally { Storage.removeItem(TOKEN.ACCESS); set({ From b6ab85b68dcef318783a2769cd66439bc95f0254 Mon Sep 17 00:00:00 2001 From: hjy080530 Date: Tue, 3 Mar 2026 23:48:10 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore(teacher):=20=EC=84=B1=EA=B3=B5?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EC=99=80=20=EC=83=81=EA=B4=80=EC=97=86?= =?UTF-8?q?=EC=9D=B4=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=ED=8A=B8=20?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/Header/NavItemList/NavItemList.tsx | 7 +++++-- src/stores/useAuthStore.ts | 19 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/common/Header/NavItemList/NavItemList.tsx b/src/components/common/Header/NavItemList/NavItemList.tsx index 8e88fd2..95e38c8 100644 --- a/src/components/common/Header/NavItemList/NavItemList.tsx +++ b/src/components/common/Header/NavItemList/NavItemList.tsx @@ -19,8 +19,11 @@ export const NavItemList = ({ authority }: NavItemListProps) => { }; const handleLogout = async () => { - await logout(); - router.push(ROUTES.MAIN); + try { + await logout(); + } finally { + router.push(ROUTES.MAIN); + } }; const ManagerNav = () => ( diff --git a/src/stores/useAuthStore.ts b/src/stores/useAuthStore.ts index ad2437c..3a426cf 100644 --- a/src/stores/useAuthStore.ts +++ b/src/stores/useAuthStore.ts @@ -32,19 +32,16 @@ export const useAuthStore = create()( logout: async () => { const { accessToken } = useAuthStore.getState(); + Storage.removeItem(TOKEN.ACCESS); + set({ + name: '', + authority: 'USER', + isLoggedIn: false, + accessToken: null, + }); try { await logoutApi(accessToken); - } catch (error) { - console.error('로그아웃 API 호출 실패:', error); - } finally { - Storage.removeItem(TOKEN.ACCESS); - set({ - name: '', - authority: 'USER', - isLoggedIn: false, - accessToken: null, - }); - } + } catch (error) {} }, updateAccessToken: (token) => {