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 (