diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro
index d3bc186..640950e 100644
--- a/src/layouts/DashboardLayout.astro
+++ b/src/layouts/DashboardLayout.astro
@@ -184,12 +184,10 @@ function isActive(item: { href: string; exact?: boolean }) {
-
+
@@ -202,6 +200,13 @@ function isActive(item: { href: string; exact?: boolean }) {
document.cookie = 'currentTeamId=' + teamSwitcher.value + '; path=/';
window.location.reload();
});
+
+ // Logout - invalidate session via fetch, then redirect
+ const logoutBtn = document.getElementById('logout-btn');
+ logoutBtn?.addEventListener('click', async () => {
+ await fetch('/api/auth/logout', { method: 'POST' });
+ window.location.href = '/';
+ });