From e91d4dbab9f644feaa6216bb6bd697156272f07e Mon Sep 17 00:00:00 2001 From: leofishman Date: Sun, 7 Jun 2026 09:37:31 -0300 Subject: [PATCH] fix(auth): hide admin setup link after language selection when system is initialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- static/js/features/auth/auth.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/features/auth/auth.js b/static/js/features/auth/auth.js index 9d2a4276..f0a2c7d2 100644 --- a/static/js/features/auth/auth.js +++ b/static/js/features/auth/auth.js @@ -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(); }