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;