diff --git a/frontend/src/App.vue b/frontend/src/App.vue index a405514e..c5e9b722 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -4468,6 +4468,7 @@ function setSession(auth) { } function clearSession() { + disconnectWebSocket(); stopDashboardRealtime(); token.value = ''; user.value = null; @@ -4534,14 +4535,22 @@ async function restoreSession() { async function logout() { try { - await api('/api/auth/logout', { method: 'POST', body: JSON.stringify({}) }); + await fetch('/api/auth/logout', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({}), + }).catch(() => {}); } finally { clearSession(); + publicModeVisible.value = true; + publicPage.value = 'home'; + updatePublicBrowserPath('home', true); showToast('Logged out.'); } } onMounted(async () => { + connectWebSocket(); if (hasWindow) { const params = new URLSearchParams(window.location.search); const oauthToken = params.get('token'); @@ -4575,6 +4584,7 @@ onMounted(async () => { }); onUnmounted(() => { + disconnectWebSocket(); if (hasWindow) { window.removeEventListener('popstate', syncPublicPageFromBrowserPath); }