fix: respect BASE_PATH in redirects, comparisons, and cookie consent paths

This commit is contained in:
Anthony Stirling
2026-06-06 19:20:07 +01:00
parent 0dff192281
commit 9da0a0d020
10 changed files with 42 additions and 27 deletions
@@ -1,4 +1,5 @@
import { AxiosInstance, AxiosError, InternalAxiosRequestConfig } from "axios";
import { withBasePath } from "@app/constants/app";
let isRefreshing = false;
let failedQueue: Array<{
@@ -89,9 +90,10 @@ async function refreshAuthToken(client: AxiosInstance): Promise<string> {
clearJwtTokenFromStorage();
// Redirect to login
if (window.location.pathname !== "/login") {
const loginPath = withBasePath("/login");
if (window.location.pathname !== loginPath) {
console.log("[API Client] Redirecting to login page...");
window.location.href = "/login";
window.location.href = loginPath;
}
throw error;