mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(web): honor baseURL path when logging out (#1851)
This commit is contained in:
parent
66696dcb18
commit
a6b463fb69
1 changed files with 5 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
import { useRouter } from "@tanstack/react-router";
|
import { redirect } from "@tanstack/react-router";
|
||||||
import { Disclosure, DisclosureButton } from "@headlessui/react";
|
import { Disclosure, DisclosureButton } from "@headlessui/react";
|
||||||
import { Bars3Icon, XMarkIcon, MegaphoneIcon } from "@heroicons/react/24/outline";
|
import { Bars3Icon, XMarkIcon, MegaphoneIcon } from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
|
@ -18,9 +18,9 @@ import { MobileNav } from "./MobileNav";
|
||||||
import { ExternalLink } from "@components/ExternalLink";
|
import { ExternalLink } from "@components/ExternalLink";
|
||||||
import { ConfigQueryOptions, UpdatesQueryOptions } from "@api/queries";
|
import { ConfigQueryOptions, UpdatesQueryOptions } from "@api/queries";
|
||||||
import { AuthContext } from "@utils/Context";
|
import { AuthContext } from "@utils/Context";
|
||||||
|
import { LoginRoute } from "@app/routes.tsx";
|
||||||
|
|
||||||
export const Header = () => {
|
export const Header = () => {
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const { isError:isConfigError, error: configError, data: config } = useQuery(ConfigQueryOptions(true));
|
const { isError:isConfigError, error: configError, data: config } = useQuery(ConfigQueryOptions(true));
|
||||||
if (isConfigError) {
|
if (isConfigError) {
|
||||||
|
@ -39,7 +39,9 @@ export const Header = () => {
|
||||||
<Toast type="success" body="You have been logged out. Goodbye!" t={t} />
|
<Toast type="success" body="You have been logged out. Goodbye!" t={t} />
|
||||||
));
|
));
|
||||||
AuthContext.reset();
|
AuthContext.reset();
|
||||||
router.history.push("/");
|
throw redirect({
|
||||||
|
to: LoginRoute.to,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
console.error("logout error", err)
|
console.error("logout error", err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue