From b46b98c5a7a05b8aaaa1ffcac52897c3e04e671f Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 24 Jul 2026 09:50:15 -0400 Subject: [PATCH] fix: settings logout buttons now call AuthManager.logout() directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced window.handleLogout indirection with direct AuthManager.logout() call - config.js already imports AuthManager from auth.js — no race condition - Same direct call as header button (auth.js line 210) --- frontend/js/config.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/frontend/js/config.js b/frontend/js/config.js index 7e4b7b1..5bd62fc 100644 --- a/frontend/js/config.js +++ b/frontend/js/config.js @@ -631,16 +631,11 @@ function initConfigModal() { }); } - // Logout button (always visible) — delegates to global handleLogout (no confirm) + // Logout button (always visible) — calls AuthManager.logout() directly var logoutBtn = document.getElementById("logout-btn"); if (logoutBtn) { logoutBtn.addEventListener("click", function() { - if (typeof window.handleLogout === 'function') { - window.handleLogout(); - } else { - fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }) - .finally(function() { window.location.href = '/'; }); - } + AuthManager.logout(); }); } @@ -1577,15 +1572,9 @@ function initProfile() { } catch(e) {} }); - // Logout button — delegates to global handleLogout (no confirm) + // Logout button — calls AuthManager.logout() directly if (logoutBtn) { logoutBtn.addEventListener('click', function() { - if (typeof window.handleLogout === 'function') { - window.handleLogout(); - } else { - fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }) - .finally(function() { window.location.href = '/'; }); - } + AuthManager.logout(); }); } -}