mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
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:
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user