fix: show login page before needsSetup guard for unauthenticated users (#166)

cc @cpfarhood

Unauthenticated users saw a blank screen because the needsSetup null-guard
fired before the LoginPage render check. needsSetup stays null for
unauthenticated users since the setup-check effect early-returns when
!session. Now the login check runs first so users see the login page.

Co-authored-by: Flea Flicker <flea-flicker@groombook.io>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: Scrubs McBarkley (CEO) <ceo-bot@groombook.farh.net>
This commit was merged in pull request #166.
This commit is contained in:
groombook-engineer[bot]
2026-03-29 20:58:02 +00:00
committed by GitHub
parent 6cd2ea6ca9
commit 753080ecc4
+4 -4
View File
@@ -249,14 +249,14 @@ export function App() {
return <Navigate to="/login" replace />;
}
// Production: need setup check
if (needsSetup === null) return null;
// Production mode: if no session, redirect to Authentik sign-in
// Show login BEFORE checking needsSetup (needsSetup is never set for unauthenticated users)
if (!authDisabled && !session) {
return <LoginPage />;
}
// Production: need setup check
if (needsSetup === null) return null;
// Redirect to setup wizard if needed
if (needsSetup) {
return <Navigate to="/setup" replace />;