diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py index 0f4160d840b..d882141fa6f 100644 --- a/litellm/proxy/auth/auth_utils.py +++ b/litellm/proxy/auth/auth_utils.py @@ -552,6 +552,18 @@ def _coerce_metadata_to_dict(value: Any) -> dict[str, Any] | None: return None +def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool: + """ + Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a + non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it. + """ + return ( + os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true" + or general_settings.get("hide_default_credentials_hint", False) is True + or bool(os.getenv("UI_PASSWORD")) + ) + + async def pre_db_read_auth_checks( request: Request, request_data: dict, @@ -1446,18 +1458,6 @@ def has_user_setup_sso() -> bool: ) -def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool: - """ - Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a - non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it. - """ - return ( - os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true" - or general_settings.get("hide_default_credentials_hint", False) is True - or bool(os.getenv("UI_PASSWORD")) - ) - - def _is_google_ready() -> bool: return bool(os.getenv("GOOGLE_CLIENT_ID")) and bool(os.getenv("GOOGLE_CLIENT_SECRET"))