This commit is contained in:
@@ -105,7 +105,7 @@ export function Sidebar() {
|
||||
|
||||
const visibleItems = navItems.filter((item) => !item.adminOnly || isAdmin);
|
||||
|
||||
// Longest match wins, so /settings/org doesn't also light up /settings.
|
||||
|
||||
const activeHref = visibleItems.reduce<string | null>((best, item) => {
|
||||
const matches = pathname === item.href || pathname.startsWith(item.href + "/");
|
||||
if (!matches) return best;
|
||||
@@ -113,11 +113,11 @@ export function Sidebar() {
|
||||
}, null);
|
||||
|
||||
async function handleLogout() {
|
||||
// /auth/logout is POST-only on the server.
|
||||
|
||||
try {
|
||||
await auth.logout();
|
||||
} catch {
|
||||
// Fall through — clearing the client-side session view is what matters.
|
||||
|
||||
}
|
||||
window.location.href = "/login";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user