diff --git a/frontend/src/utils/auth.ts b/frontend/src/utils/auth.ts index 95277878..f973d8dd 100644 --- a/frontend/src/utils/auth.ts +++ b/frontend/src/utils/auth.ts @@ -2,7 +2,7 @@ import { useAuthStore } from "@/stores/auth"; import router from "@/router"; import type { JwtPayload } from "jwt-decode"; import { jwtDecode } from "jwt-decode"; -import { baseURL, noAuth, logoutPage } from "./constants"; +import { authMethod, baseURL, noAuth, logoutPage } from "./constants"; import { StatusError } from "@/api/utils"; import { setSafeTimeout } from "@/api/utils"; @@ -18,6 +18,12 @@ export function parseToken(token: string) { authStore.jwt = token; authStore.setUser(data.user); + // proxy auth with custom logout subject to unknown external timeout + if (logoutPage !== "/login" && authMethod === "proxy") { + console.warn("idle timeout disabled with proxy auth and custom logout"); + return; + } + if (authStore.logoutTimer) { clearTimeout(authStore.logoutTimer); }