Restore enterprise/LDAP login mode detection
- Added /users/auth-mode public endpoint to detect LDAP status - Updated frontend to call getAuthMode() instead of hardcoded false - Login page now automatically switches to enterprise mode when LDAP is enabled - Fixes missing LDAP user login UI that was previously disabled with TODO comment This restores the functionality that was commented out earlier where the login page would auto-detect whether to show local user list or enterprise username input.
This commit is contained in:
@@ -257,6 +257,16 @@ def login(request: Request, form_data: schemas.UserLogin, db: Session = Depends(
|
||||
)
|
||||
|
||||
|
||||
@router.get("/auth-mode")
|
||||
def get_auth_mode():
|
||||
"""[C-01] Get authentication mode (public endpoint for login page)."""
|
||||
config = get_ldap_config()
|
||||
return {
|
||||
"mode": "enterprise" if config.get("ldap_enabled") else "local",
|
||||
"ldap_enabled": config.get("ldap_enabled", False)
|
||||
}
|
||||
|
||||
|
||||
@router.get("/ldap-config")
|
||||
def get_ldap_settings(current_user: auth.TokenData = Depends(auth.get_current_admin)):
|
||||
"""[C-01] Get LDAP config — admin only."""
|
||||
|
||||
Reference in New Issue
Block a user