mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 03:47:49 +01:00
feat: better error message
This commit is contained in:
@@ -120,12 +120,14 @@ async def signin(request: Request, form_data: SigninForm):
|
||||
user = Auths.authenticate_user_by_trusted_header(trusted_email)
|
||||
|
||||
if WEBUI_AUTH == False:
|
||||
|
||||
if Users.get_num_users() != 0:
|
||||
raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS)
|
||||
|
||||
admin_email = "admin@localhost"
|
||||
admin_password = "admin"
|
||||
|
||||
if Users.get_num_users() == 0 and not Users.get_user_by_email(
|
||||
admin_email.lower()
|
||||
):
|
||||
if not Users.get_user_by_email(admin_email.lower()):
|
||||
await signup(
|
||||
request,
|
||||
SignupForm(email=admin_email, password=admin_password, name="User"),
|
||||
|
||||
Reference in New Issue
Block a user