From 8338bd9c539aa48d2a1bb20e593b277a46743074 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Mon, 8 Dec 2025 16:30:37 -0800 Subject: [PATCH] Change deprecation banner to only show on /sso/key/generate --- .../proxy/common_utils/html_forms/ui_login.py | 26 ++++++++++--- litellm/proxy/proxy_server.py | 10 +++-- tests/test_litellm/proxy/test_proxy_server.py | 38 +++++++++++++++++++ 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/litellm/proxy/common_utils/html_forms/ui_login.py b/litellm/proxy/common_utils/html_forms/ui_login.py index 8478d41e47..42cfb592a7 100644 --- a/litellm/proxy/common_utils/html_forms/ui_login.py +++ b/litellm/proxy/common_utils/html_forms/ui_login.py @@ -8,7 +8,22 @@ if server_root_path != "": url_to_redirect_to += server_root_path url_to_redirect_to += "/login" new_ui_login_url = get_custom_url("", "ui/login") -html_form = f""" + + +def build_ui_login_form(show_deprecation_banner: bool = False) -> str: + banner_html = ( + f""" +
+ Deprecated: Logging in with username and password on this page is deprecated. + Please use the new login page instead. + This page will be dedicated to signing in via SSO in the future. +
+ """ + if show_deprecation_banner + else "" + ) + + return f""" @@ -209,11 +224,7 @@ html_form = f"""
-
- Deprecated: Logging in with username and password on this page is deprecated. - Please use the new login page instead. - This page will be dedicated to signing in via SSO in the future. -
+ {banner_html}