diff --git a/frontend/app/login/page.tsx b/frontend/app/login/page.tsx index 773e0ae1..f5e959ea 100644 --- a/frontend/app/login/page.tsx +++ b/frontend/app/login/page.tsx @@ -9,6 +9,7 @@ import { useRouter } from 'next/navigation'; export default function LoginPage() { const [mounted, setMounted] = useState(false); const [users, setUsers] = useState([]); + const [ldapAvailable, setLdapAvailable] = useState(false); const [isEnterprise, setIsEnterprise] = useState(false); const [isLoading, setIsLoading] = useState(true); const [selectedUserForLogin, setSelectedUserForLogin] = useState(null); @@ -25,13 +26,15 @@ export default function LoginPage() { setIsLoading(true); // Get authentication mode from backend const authMode = await inventoryApi.getAuthMode(); - setIsEnterprise(authMode.mode === 'enterprise'); + setLdapAvailable(authMode.ldap_enabled); + setIsEnterprise(false); // Always start with local mode for user choice const userList = await inventoryApi.getUsers(); setUsers(userList); } catch (error) { console.error("Failed to load auth mode or users", error); - setIsEnterprise(false); // Default to local mode on error + setLdapAvailable(false); + setIsEnterprise(false); } finally { setIsLoading(false); } @@ -81,6 +84,32 @@ export default function LoginPage() { ) : (
+ {ldapAvailable && ( +
+ + +
+ )} {!selectedUserForLogin && !isEnterprise ? ( <> {users.length > 0 ? (