From a3627569466677d3c0f585af3e04b7ce7a14249f Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 14 Jul 2025 00:10:53 +0000 Subject: fix: Clear search history on logout --- apps/web/components/dashboard/header/ProfileOptions.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'apps/web/components/dashboard') diff --git a/apps/web/components/dashboard/header/ProfileOptions.tsx b/apps/web/components/dashboard/header/ProfileOptions.tsx index 3d125606..7ccc0078 100644 --- a/apps/web/components/dashboard/header/ProfileOptions.tsx +++ b/apps/web/components/dashboard/header/ProfileOptions.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import { redirect } from "next/navigation"; +import { redirect, useRouter } from "next/navigation"; import { useToggleTheme } from "@/components/theme-provider"; import { Button } from "@/components/ui/button"; import { @@ -13,7 +13,7 @@ import { import { Separator } from "@/components/ui/separator"; import { useTranslation } from "@/lib/i18n/client"; import { LogOut, Moon, Paintbrush, Settings, Shield, Sun } from "lucide-react"; -import { signOut, useSession } from "next-auth/react"; +import { useSession } from "next-auth/react"; import { useTheme } from "next-themes"; import { AdminNoticeBadge } from "../../admin/AdminNotices"; @@ -43,6 +43,7 @@ export default function SidebarProfileOptions() { const { t } = useTranslation(); const toggleTheme = useToggleTheme(); const { data: session } = useSession(); + const router = useRouter(); if (!session) return redirect("/"); return ( @@ -94,13 +95,7 @@ export default function SidebarProfileOptions() { - - signOut({ - callbackUrl: "/", - }) - } - > + router.push("/logout")}> {t("actions.sign_out")} -- cgit v1.2.3-70-g09d2