From 56cce7e5853def43b83d467d8454eb7304b3907e Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Mar 2026 21:48:54 +0530 Subject: [PATCH] Fix: allow UI login without database when DATABASE_URL is not set --- litellm/proxy/auth/login_utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/auth/login_utils.py b/litellm/proxy/auth/login_utils.py index c7e22516fe5..860494a7872 100644 --- a/litellm/proxy/auth/login_utils.py +++ b/litellm/proxy/auth/login_utils.py @@ -189,11 +189,14 @@ async def authenticate_user( # noqa: PLR0915 }, # type: ignore ) else: - raise ProxyException( - message="No Database connected. Set DATABASE_URL in .env. If set, use `--detailed_debug` to debug issue.", - type=ProxyErrorTypes.auth_error, - param="DATABASE_URL", - code=500, + key = secrets.token_urlsafe(32) + + return LoginResult( + user_id=user_id, + key=key, + user_email=None, + user_role=user_role, + login_method="username_password", ) key = response["token"] # type: ignore