mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(fix) proxy - remove PROXY_BASE_URL
This commit is contained in:
parent
631657ba5e
commit
932d07c5e6
1 changed files with 4 additions and 16 deletions
|
@ -3059,14 +3059,7 @@ async def login(request: Request):
|
||||||
if litellm_ui_link_in_env is not None:
|
if litellm_ui_link_in_env is not None:
|
||||||
litellm_dashboard_ui = litellm_ui_link_in_env
|
litellm_dashboard_ui = litellm_ui_link_in_env
|
||||||
|
|
||||||
litellm_dashboard_ui += (
|
litellm_dashboard_ui += "?userID=" + user_id + "&accessToken=" + key
|
||||||
"?userID="
|
|
||||||
+ user_id
|
|
||||||
+ "&accessToken="
|
|
||||||
+ key
|
|
||||||
+ "&proxyBaseUrl="
|
|
||||||
+ os.getenv("PROXY_BASE_URL")
|
|
||||||
)
|
|
||||||
return RedirectResponse(url=litellm_dashboard_ui)
|
return RedirectResponse(url=litellm_dashboard_ui)
|
||||||
else:
|
else:
|
||||||
raise ProxyException(
|
raise ProxyException(
|
||||||
|
@ -3084,14 +3077,9 @@ async def auth_callback(request: Request):
|
||||||
microsoft_client_id = os.getenv("MICROSOFT_CLIENT_ID", None)
|
microsoft_client_id = os.getenv("MICROSOFT_CLIENT_ID", None)
|
||||||
google_client_id = os.getenv("GOOGLE_CLIENT_ID", None)
|
google_client_id = os.getenv("GOOGLE_CLIENT_ID", None)
|
||||||
|
|
||||||
redirect_url = os.getenv("PROXY_BASE_URL", None)
|
# get url from request
|
||||||
if redirect_url is None:
|
redirect_url = str(request.base_url)
|
||||||
raise ProxyException(
|
|
||||||
message="PROXY_BASE_URL not set. Set it in .env file",
|
|
||||||
type="auth_error",
|
|
||||||
param="PROXY_BASE_URL",
|
|
||||||
code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
|
||||||
)
|
|
||||||
if redirect_url.endswith("/"):
|
if redirect_url.endswith("/"):
|
||||||
redirect_url += "sso/callback"
|
redirect_url += "sso/callback"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue