From 015f401a705b413773db6b98d5e99f9a1e904d2d Mon Sep 17 00:00:00 2001 From: Project_IO Date: Tue, 18 Mar 2025 16:47:26 +0900 Subject: [PATCH] feat: logout --- src/components/logout/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/logout/index.tsx b/src/components/logout/index.tsx index f1563de..acbcb0d 100644 --- a/src/components/logout/index.tsx +++ b/src/components/logout/index.tsx @@ -2,10 +2,12 @@ import { useAuthStore } from "../../store/auth"; function Logout() { const auth = useAuthStore(); - auth.clearToken(); - + if (auth.token !== null) + auth.clearToken(); + document.location.href = "/"; - return <>; + + return <>Redirecting...; } export default Logout;