bypass automatic session timeout (re: #5439) when proxy auth with custom logout is used
This commit is contained in:
parent
d3a9f34295
commit
eebfdbc8ae
@ -2,7 +2,7 @@ import { useAuthStore } from "@/stores/auth";
|
|||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import type { JwtPayload } from "jwt-decode";
|
import type { JwtPayload } from "jwt-decode";
|
||||||
import { jwtDecode } 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 { StatusError } from "@/api/utils";
|
||||||
import { setSafeTimeout } from "@/api/utils";
|
import { setSafeTimeout } from "@/api/utils";
|
||||||
|
|
||||||
@ -18,6 +18,12 @@ export function parseToken(token: string) {
|
|||||||
authStore.jwt = token;
|
authStore.jwt = token;
|
||||||
authStore.setUser(data.user);
|
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) {
|
if (authStore.logoutTimer) {
|
||||||
clearTimeout(authStore.logoutTimer);
|
clearTimeout(authStore.logoutTimer);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user