diff --git a/frontend/src/utils/auth.ts b/frontend/src/utils/auth.ts index 5fe8ce31..e30f6556 100644 --- a/frontend/src/utils/auth.ts +++ b/frontend/src/utils/auth.ts @@ -1,7 +1,7 @@ import { useAuthStore } from "@/stores/auth"; import router from "@/router"; import { JwtPayload, jwtDecode } from "jwt-decode"; -import { baseURL } from "./constants"; +import { baseURL, noAuth } from "./constants"; import { StatusError } from "@/api/utils"; export function parseToken(token: string) { @@ -98,5 +98,9 @@ export function logout() { authStore.clearUser(); localStorage.setItem("jwt", ""); - router.push({ path: "/login" }); + if (noAuth) { + window.location.reload(); + } else { + router.push({path: "/login"}); + } }