Skip to content

Commit

Permalink
Merge pull request #2118 from open-webui/dev
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
tjbck committed May 9, 2024
2 parents 734e62b 26ee547 commit 90503be
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions backend/apps/web/routers/auths.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 118,24 @@ async def signin(request: Request, form_data: SigninForm):
),
)
user = Auths.authenticate_user_by_trusted_header(trusted_email)
else:
if WEBUI_AUTH == False:

admin_email = "admin@localhost"
admin_password = "admin"
elif WEBUI_AUTH == False:
admin_email = "admin@localhost"
admin_password = "admin"

if Users.get_user_by_email(admin_email.lower()):
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
if Users.get_num_users() != 0:
raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS)
if Users.get_user_by_email(admin_email.lower()):
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
if Users.get_num_users() != 0:
raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS)

await signup(
request,
SignupForm(email=admin_email, password=admin_password, name="User"),
)
await signup(
request,
SignupForm(email=admin_email, password=admin_password, name="User"),
)

user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
user = Auths.authenticate_user(form_data.email.lower(), form_data.password)
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
user = Auths.authenticate_user(form_data.email.lower(), form_data.password)

if user:
token = create_token(
Expand Down

0 comments on commit 90503be

Please sign in to comment.