fix: Sign out button in settings dropdown not working
The header dropdown 'Sign out' menu item used onclick='handleLogout()' but handleLogout was never defined as a global function. Added window.handleLogout in auth.js that delegates to AuthManager.logout(), same as the existing logout-btn handler.
This commit is contained in:
@@ -201,6 +201,9 @@ const AuthManager = {
|
|||||||
const logoutBtn = document.getElementById("logout-btn");
|
const logoutBtn = document.getElementById("logout-btn");
|
||||||
if (logoutBtn) logoutBtn.addEventListener("click", () => AuthManager.logout());
|
if (logoutBtn) logoutBtn.addEventListener("click", () => AuthManager.logout());
|
||||||
|
|
||||||
|
// Also wire up the header dropdown "Sign out" (onclick="handleLogout()")
|
||||||
|
window.handleLogout = () => AuthManager.logout();
|
||||||
|
|
||||||
const adminRow = document.getElementById("admin-menu-row");
|
const adminRow = document.getElementById("admin-menu-row");
|
||||||
if (adminRow) {
|
if (adminRow) {
|
||||||
if (user.role === "admin") {
|
if (user.role === "admin") {
|
||||||
|
|||||||
Reference in New Issue
Block a user