From eccbfbfeea671f2c492d10d0d28c8d1abc935614 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 8 Jun 2026 22:43:17 +0000 Subject: [PATCH] Fix user portal blank after login - initUser() now hides auth-check and shows main-layout on success - Remove conflicting inline script from user/index.php that referenced #app (non-existent) instead of #main-layout, causing null JS error that prevented the panel from ever rendering after successful auth - Wire logout button in boot sequence (was only in the removed inline script) Co-Authored-By: Claude Sonnet 4.6 --- panel/public/assets/js/user.js | 7 ++ panel/public/user/index.php | 116 +-------------------------------- 2 files changed, 8 insertions(+), 115 deletions(-) diff --git a/panel/public/assets/js/user.js b/panel/public/assets/js/user.js index 7124069..8393416 100644 --- a/panel/public/assets/js/user.js +++ b/panel/public/assets/js/user.js @@ -14,6 +14,8 @@ async function initUser() { } _user = res.data; document.getElementById('user-name').textContent = _user.username || 'User'; + document.getElementById('auth-check').style.display = 'none'; + document.getElementById('main-layout').style.display = ''; return true; } @@ -1008,6 +1010,11 @@ window.uDockerLaunchApp = async (preselect) => { document.addEventListener('DOMContentLoaded', async () => { const ok = await initUser(); if (!ok) return; + document.getElementById('logout-btn')?.addEventListener('click', async e => { + e.preventDefault(); + await Nova.api('auth', 'logout', { method: 'POST' }); + location.href = '/'; + }); renderNav(); window.userNav('dashboard'); }); diff --git a/panel/public/user/index.php b/panel/public/user/index.php index b186006..4339953 100644 --- a/panel/public/user/index.php +++ b/panel/public/user/index.php @@ -209,120 +209,6 @@ window.NOVACPX_BRANDING = - +