From 8e0d9090be6bcd27d3f27568639fc8d706c2d23e Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Wed, 18 Feb 2026 18:07:27 -0800 Subject: [PATCH] fix: replace Firebase signOut with NextAuth signOut in left rail Firebase is not configured - auth was undefined causing the error 'Cannot read properties of undefined (reading signOut)'. Use next-auth/react signOut with callbackUrl to redirect to /auth. Co-authored-by: Cursor --- components/layout/workspace-left-rail.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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 (