mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(auth): correct redirect on bad session cookie (#1475)
This commit is contained in:
parent
67980776b6
commit
d1f0ec94cd
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
import { QueryCache, QueryClient } from "@tanstack/react-query";
|
import { QueryCache, QueryClient } from "@tanstack/react-query";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "@components/notifications/Toast";
|
import Toast from "@components/notifications/Toast";
|
||||||
|
import { baseUrl } from "@utils";
|
||||||
|
|
||||||
const MAX_RETRIES = 6;
|
const MAX_RETRIES = 6;
|
||||||
const HTTP_STATUS_TO_NOT_RETRY = [400, 401, 403, 404];
|
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
|
// @ts-expect-error TS2339: Property status does not exist on type Error
|
||||||
console.error("bad status, redirect to login", error?.status)
|
console.error("bad status, redirect to login", error?.status)
|
||||||
// Redirect to login page
|
// Redirect to login page
|
||||||
window.location.href = "/login";
|
window.location.href = baseUrl()+"login";
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue