diff --git a/frontend-modern/src/components/Login.tsx b/frontend-modern/src/components/Login.tsx index 600bfb374..9224047b3 100644 --- a/frontend-modern/src/components/Login.tsx +++ b/frontend-modern/src/components/Login.tsx @@ -78,38 +78,49 @@ export const Login: Component = (props) => { // Debug logging console.log('[Login] Render - loadingAuth:', loadingAuth(), 'authStatus:', authStatus()); - // Show loading state while checking auth status - if (loadingAuth()) { - return ( -
-
-
-

Checking authentication...

-
-
- ); - } - - // Show FirstRunSetup if no authentication is configured - const status = authStatus(); - - if (status && status.hasAuthentication === false) { - console.log('[Login] Showing FirstRunSetup because hasAuthentication is false'); - return ( -
-

Loading setup...

+

Checking authentication...

- }> - -
- ); - } + } + > + } + > + +
+
+

Loading setup...

+
+ + }> + +
+
+ + ); +}; + +// Extract login form to separate component for cleaner code +const LoginForm: Component<{ + username: () => string; + setUsername: (v: string) => void; + password: () => string; + setPassword: (v: string) => void; + error: () => string; + loading: () => boolean; + handleSubmit: (e: Event) => void; +}> = (props) => { + const { username, setUsername, password, setPassword, error, loading, handleSubmit } = props; - // Show login form if authentication is configured return (