Skip to content

Commit

Permalink
fix(auth): correct redirect on bad session cookie (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
zze0s committed Mar 24, 2024
1 parent 6798077 commit d1f0ec9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/api/QueryClient.tsx
Expand Up @@ -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];
Expand All @@ -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
}
Expand Down

0 comments on commit d1f0ec9

Please sign in to comment.