security fix - disable demo accounts

This commit is contained in:
Ishaan Jaff 2024-04-11 07:40:34 -07:00
parent 1c1b0f929f
commit 96cd038a73

View file

@ -7656,10 +7656,12 @@ async def login(request: Request):
**{"user_role": "proxy_admin", "duration": "1hr", "key_max_budget": 5, "models": [], "aliases": {}, "config": {}, "spend": 0, "user_id": key_user_id, "team_id": "litellm-dashboard"} # type: ignore **{"user_role": "proxy_admin", "duration": "1hr", "key_max_budget": 5, "models": [], "aliases": {}, "config": {}, "spend": 0, "user_id": key_user_id, "team_id": "litellm-dashboard"} # type: ignore
) )
else: else:
response = { raise ProxyException(
"token": "sk-gm", message="No Database connected. Set DATABASE_URL in .env. If set, use `--detailed_debug` to debug issue.",
"user_id": "litellm-dashboard", type="auth_error",
} param="DATABASE_URL",
code=status.HTTP_500_INTERNAL_SERVER_ERROR,
)
key = response["token"] # type: ignore key = response["token"] # type: ignore
litellm_dashboard_ui = os.getenv("PROXY_BASE_URL", "") litellm_dashboard_ui = os.getenv("PROXY_BASE_URL", "")
if litellm_dashboard_ui.endswith("/"): if litellm_dashboard_ui.endswith("/"):