diff --git a/frontend/src/components/layout/sidebar.rs b/frontend/src/components/layout/sidebar.rs index 2b9cfbb..9ce538e 100644 --- a/frontend/src/components/layout/sidebar.rs +++ b/frontend/src/components/layout/sidebar.rs @@ -74,9 +74,21 @@ pub fn Sidebar() -> impl IntoView { } }; + let handle_logout = move |_| { + spawn_local(async move { + let client = gloo_net::http::Request::post("/api/auth/logout"); + if let Ok(resp) = client.send().await { + if resp.ok() { + // Force full reload to clear state + let _ = window().location().set_href("/login"); + } + } + }); + }; + view! {