Revert "(UI) - Improvements to session handling logic (#8970)"
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 15s

This reverts commit c015fb34f1.
This commit is contained in:
Ishaan Jaff 2025-03-04 13:29:08 -08:00
parent 772c2b1fff
commit 4c8b4fefc9
7 changed files with 52 additions and 116 deletions

View file

@ -7372,8 +7372,6 @@ async def login(request: Request): # noqa: PLR0915
import multipart
except ImportError:
subprocess.run(["pip", "install", "python-multipart"])
from litellm.proxy.management_helpers.ui_session_handler import UISessionHandler
global master_key
if master_key is None:
raise ProxyException(
@ -7491,9 +7489,9 @@ async def login(request: Request): # noqa: PLR0915
algorithm="HS256",
)
litellm_dashboard_ui += "?userID=" + user_id
return UISessionHandler.generate_authenticated_redirect_response(
redirect_url=litellm_dashboard_ui, jwt_token=jwt_token
)
redirect_response = RedirectResponse(url=litellm_dashboard_ui, status_code=303)
redirect_response.set_cookie(key="token", value=jwt_token)
return redirect_response
elif _user_row is not None:
"""
When sharing invite links
@ -7559,9 +7557,11 @@ async def login(request: Request): # noqa: PLR0915
algorithm="HS256",
)
litellm_dashboard_ui += "?userID=" + user_id
return UISessionHandler.generate_authenticated_redirect_response(
redirect_url=litellm_dashboard_ui, jwt_token=jwt_token
redirect_response = RedirectResponse(
url=litellm_dashboard_ui, status_code=303
)
redirect_response.set_cookie(key="token", value=jwt_token)
return redirect_response
else:
raise ProxyException(
message=f"Invalid credentials used to access UI.\nNot valid credentials for {username}",