Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 0a416d2

Browse files
committed
fix(menu): use router for logout functionality and clean up imports
1 parent 5bf0a73 commit 0a416d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/dashboard/menu.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
22

3-
import { Link } from "@/src/i18n/routing"
3+
import { Link, useRouter } from "@/src/i18n/routing"
44
import { Ellipsis, LogOut } from "lucide-react"
55
import { usePathname } from "next/navigation"
66

@@ -10,8 +10,8 @@ import { Button } from "@/src/components/new-york/ui/button"
1010
import { ScrollArea } from "@/src/components/new-york/ui/scroll-area"
1111
import { CollapseMenuButton } from "@/src/components/dashboard/collapse-menu-button"
1212
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/src/components/new-york/ui/tooltip"
13-
import { signOut } from "next-auth/react"
1413
import { SidebarStrings } from "@/src/app/hooks/translations/use-sidebar-translations"
14+
import { BASE_PATH } from "@/src/lib/routes"
1515

1616
interface MenuProps {
1717
isOpen: boolean | undefined
@@ -22,6 +22,8 @@ export function Menu({ isOpen, navStrings }: MenuProps) {
2222
const pathname = usePathname()
2323
const menuList = getMenuList(pathname, navStrings)
2424

25+
const router = useRouter()
26+
2527
return (
2628
<ScrollArea className='[&>div>div[style]]:!block'>
2729
<nav className='mt-8 h-full w-full'>
@@ -92,9 +94,7 @@ export function Menu({ isOpen, navStrings }: MenuProps) {
9294
<TooltipTrigger asChild>
9395
<Button
9496
onClick={async () => {
95-
await signOut({
96-
callbackUrl: "/login",
97-
})
97+
router.push(`${BASE_PATH}/logout`)
9898
}}
9999
variant='outline'
100100
className='mt-5 h-10 w-full justify-center'

0 commit comments

Comments
 (0)