diff --git a/components/layout/workspace-left-rail.tsx b/components/layout/workspace-left-rail.tsx index 6d4051a..63914f0 100644 --- a/components/layout/workspace-left-rail.tsx +++ b/components/layout/workspace-left-rail.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import { usePathname, useRouter } from "next/navigation"; +import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; import { LayoutGrid, @@ -13,9 +13,7 @@ import { LogOut, } from "lucide-react"; import { Separator } from "@/components/ui/separator"; -import { signOut } from "@/lib/firebase/auth"; -import { toast } from "sonner"; - +import { signOut } from "next-auth/react"; interface WorkspaceLeftRailProps { activeSection?: string; onSectionChange: (section: string) => void; @@ -56,19 +54,12 @@ const navItems = [ export function WorkspaceLeftRail({ activeSection = 'projects', onSectionChange }: WorkspaceLeftRailProps) { const pathname = usePathname(); - const router = useRouter(); // Extract workspace from pathname (e.g., /marks-account/projects -> marks-account) const workspace = pathname?.split('/')[1] || 'marks-account'; const handleSignOut = async () => { - try { - await signOut(); - toast.success("Signed out successfully"); - router.push("/auth"); - } catch (error: any) { - toast.error(error.message); - } + await signOut({ callbackUrl: "/auth" }); }; return (