fix(auth): hide admin setup link after language selection when system is initialized

When a new browser visits the login page, the language selector runs first.
After the user selects a language and clicks continue, the code checked
system status and correctly showed the login panel when `initialized=true`
— but did not hide the "Set up administrator" link.

That link was only hidden by `showInitialPanel()`, which returns early
(without reaching the hide logic) whenever `isFirstRun()` is true. So on
any browser that had not previously stored the locale key, the link stayed
visible and clickable, leading users back to the admin setup panel even
after an admin already existed.

Fix: hide the link in the language-continue handler's `else` branch,
mirroring the same guard already present in `showInitialPanel()`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
leofishman
2026-06-07 09:37:31 -03:00
parent eb0ba58158
commit e91d4dbab9
+5
View File
@@ -628,6 +628,11 @@ function initLanguageSelector() {
}
} else {
showPanel(document.getElementById('login-panel'));
// Hide "Set up administrator" link since an admin already exists
const setupLink = document.getElementById('show-admin-setup');
if (setupLink && systemStatus.admin_count > 0) {
setupLink.parentElement.style.display = 'none';
}
// Configure OIDC login UI if SSO is enabled
await configureOidcLoginUI();
}