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 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 22:43:17 +00:00
parent 77f88ca5bf
commit eccbfbfeea
2 changed files with 8 additions and 115 deletions
+7
View File
@@ -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');
});