fix: navbar refreshes auth state on navigation

Login button now correctly changes to Logout after login
This commit is contained in:
2026-06-30 23:28:47 -05:00
parent 2353198924
commit 73be5d2f22
+1 -1
View File
@@ -52,7 +52,7 @@ export default function Navbar() {
link.href = data.data; link.href = data.data;
}) })
.catch(() => {}); .catch(() => {});
}, []); }, [pathname]);
const handleLogout = async () => { const handleLogout = async () => {
await fetch('/api/auth/logout', { method: 'POST', credentials: 'same-origin' }); await fetch('/api/auth/logout', { method: 'POST', credentials: 'same-origin' });