@@ -2709,13 +2709,15 @@ def decrypt_value(value: bytes, master_key: str) -> str:
2709
2709
2710
2710
2711
2711
# LiteLLM Admin UI - Non SSO Login
2712
- html_form = """
2712
+ url_to_redirect_to = os .getenv ("PROXY_BASE_URL" , "" )
2713
+ url_to_redirect_to += "/login"
2714
+ html_form = f"""
2713
2715
<!DOCTYPE html>
2714
2716
<html>
2715
2717
<head>
2716
2718
<title>LiteLLM Login</title>
2717
2719
<style>
2718
- body {
2720
+ body {{
2719
2721
font-family: Arial, sans-serif;
2720
2722
background-color: #f4f4f4;
2721
2723
margin: 0;
@@ -2724,42 +2726,42 @@ def decrypt_value(value: bytes, master_key: str) -> str:
2724
2726
justify-content: center;
2725
2727
align-items: center;
2726
2728
height: 100vh;
2727
- }
2729
+ }}
2728
2730
2729
- form {
2731
+ form {{
2730
2732
background-color: #fff;
2731
2733
padding: 20px;
2732
2734
border-radius: 8px;
2733
2735
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
2734
- }
2736
+ }}
2735
2737
2736
- label {
2738
+ label {{
2737
2739
display: block;
2738
2740
margin-bottom: 8px;
2739
- }
2741
+ }}
2740
2742
2741
- input {
2743
+ input {{
2742
2744
width: 100%;
2743
2745
padding: 8px;
2744
2746
margin-bottom: 16px;
2745
2747
box-sizing: border-box;
2746
2748
border: 1px solid #ccc;
2747
2749
border-radius: 4px;
2748
- }
2750
+ }}
2749
2751
2750
- input[type="submit"] {
2752
+ input[type="submit"] {{
2751
2753
background-color: #4caf50;
2752
2754
color: #fff;
2753
2755
cursor: pointer;
2754
- }
2756
+ }}
2755
2757
2756
- input[type="submit"]:hover {
2758
+ input[type="submit"]:hover {{
2757
2759
background-color: #45a049;
2758
- }
2760
+ }}
2759
2761
</style>
2760
2762
</head>
2761
2763
<body>
2762
- <form action="/login " method="post">
2764
+ <form action="{ url_to_redirect_to } " method="post">
2763
2765
<h2>LiteLLM Login</h2>
2764
2766
2765
2767
<p>By default Username is "admin" and Password is your set LiteLLM Proxy `MASTER_KEY`</p>
@@ -2771,8 +2773,6 @@ def decrypt_value(value: bytes, master_key: str) -> str:
2771
2773
<input type="password" id="password" name="password" required>
2772
2774
<input type="submit" value="Submit">
2773
2775
</form>
2774
- </body>
2775
- </html>
2776
2776
"""
2777
2777
2778
2778
0 commit comments