From eebfdbc8ae18cdd6b7e09cec923df23e299d64db Mon Sep 17 00:00:00 2001 From: jake-dog Date: Thu, 27 Nov 2025 21:49:03 -0500 Subject: [PATCH] bypass automatic session timeout (re: #5439) when proxy auth with custom logout is used --- frontend/src/utils/auth.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); }