mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
ui - use cookies to return JWTs
This commit is contained in:
parent
94d65d4c86
commit
7065c9838f
1 changed files with 14 additions and 6 deletions
|
@ -7514,8 +7514,10 @@ async def login(request: Request):
|
||||||
"secret",
|
"secret",
|
||||||
algorithm="HS256",
|
algorithm="HS256",
|
||||||
)
|
)
|
||||||
litellm_dashboard_ui += "?userID=" + user_id + "&token=" + jwt_token
|
litellm_dashboard_ui += "?userID=" + user_id
|
||||||
return RedirectResponse(url=litellm_dashboard_ui, status_code=303)
|
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:
|
elif _user_row is not None:
|
||||||
"""
|
"""
|
||||||
When sharing invite links
|
When sharing invite links
|
||||||
|
@ -7576,8 +7578,12 @@ async def login(request: Request):
|
||||||
"secret",
|
"secret",
|
||||||
algorithm="HS256",
|
algorithm="HS256",
|
||||||
)
|
)
|
||||||
litellm_dashboard_ui += "?userID=" + user_id + "&token=" + jwt_token
|
litellm_dashboard_ui += "?userID=" + user_id
|
||||||
return RedirectResponse(url=litellm_dashboard_ui, status_code=303)
|
redirect_response = RedirectResponse(
|
||||||
|
url=litellm_dashboard_ui, status_code=303
|
||||||
|
)
|
||||||
|
redirect_response.set_cookie(key="token", value=jwt_token)
|
||||||
|
return redirect_response
|
||||||
else:
|
else:
|
||||||
raise ProxyException(
|
raise ProxyException(
|
||||||
message=f"Invalid credentials used to access UI. Passed in username: {username}, passed in password: {password}.\nNot valid credentials for {username}",
|
message=f"Invalid credentials used to access UI. Passed in username: {username}, passed in password: {password}.\nNot valid credentials for {username}",
|
||||||
|
@ -8120,8 +8126,10 @@ async def auth_callback(request: Request):
|
||||||
"secret",
|
"secret",
|
||||||
algorithm="HS256",
|
algorithm="HS256",
|
||||||
)
|
)
|
||||||
litellm_dashboard_ui += "?userID=" + user_id + "&token=" + jwt_token
|
litellm_dashboard_ui += "?userID=" + user_id
|
||||||
return RedirectResponse(url=litellm_dashboard_ui)
|
redirect_response = RedirectResponse(url=litellm_dashboard_ui, status_code=303)
|
||||||
|
redirect_response.set_cookie(key="token", value=jwt_token)
|
||||||
|
return redirect_response
|
||||||
|
|
||||||
|
|
||||||
#### INVITATION MANAGEMENT ####
|
#### INVITATION MANAGEMENT ####
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue