From 62f34894e17e48ccbc2a6f40f0e420ce342ff319 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 22 Jul 2026 11:10:12 +0000 Subject: [PATCH] Add name, email and sign out button to sidebar footer Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/Layout.tsx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 62a1b06..b708f8f 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -3,7 +3,7 @@ import { LayoutDashboard, Upload, FileText, Search, List, AlertCircle, ShoppingCart, TrendingUp, BarChart2, PieChart, Activity, RefreshCw, Calendar, Users, Hotel, BookOpen, Wheat, ChefHat, UtensilsCrossed, - Menu, ShieldCheck, Package, Settings, ChevronRight, TableProperties, + Menu, ShieldCheck, Package, Settings, ChevronRight, TableProperties, LogOut, } from 'lucide-react' import { useAuth } from './AuthGate' import { can } from '../types' @@ -31,6 +31,11 @@ function NavItem({ to, label, icon: Icon }: { to: string; label: string; icon: R export default function Layout() { const { user } = useAuth() + async function logout() { + await fetch('/kitchen/api/auth/logout', { method: 'POST', credentials: 'include' }) + window.location.reload() + } + return (
{/* Mobile top bar */}