fix: don't redirect to login when no auth (#3165)
Co-authored-by: Piotr Markiewicz <piotr.markiewicz@vaimo.com>
This commit is contained in:
parent
bee71d93fe
commit
da5a6e051f
|
@ -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"});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue