diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index de69058..f1004cb 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -1,7 +1,7 @@ import { NavLink } from 'react-router-dom' import { TrendingUp, BarChart2, Target, History, - Settings, Bot, + Settings, Bot, LogOut, } from 'lucide-react' import { useAuth } from './AuthGate' import { can } from '../types' @@ -21,6 +21,11 @@ export default function Layout({ children }: { children: ReactNode }) { const { user } = useAuth() const items = NAV.filter(n => can(user, n.cap)) + async function logout() { + await fetch('/forecasting/api/auth/logout', { method: 'POST', credentials: 'include' }) + window.location.reload() + } + return (