fix(auth): correct redirect on bad session cookie (#1475)

This commit is contained in:
ze0s 2024-03-24 12:18:55 +01:00 committed by GitHub
parent 67980776b6
commit d1f0ec94cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@
import { QueryCache, QueryClient } from "@tanstack/react-query";
import { toast } from "react-hot-toast";
import Toast from "@components/notifications/Toast";
import { baseUrl } from "@utils";
const MAX_RETRIES = 6;
const HTTP_STATUS_TO_NOT_RETRY = [400, 401, 403, 404];
@ -22,7 +23,7 @@ export const queryClient = new QueryClient({
// @ts-expect-error TS2339: Property status does not exist on type Error
console.error("bad status, redirect to login", error?.status)
// Redirect to login page
window.location.href = "/login";
window.location.href = baseUrl()+"login";
return
}