"src/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "f9462ff8551160130b48ea76e8d759b371c5c430"
Commit 01e020d1 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix

parent 88e8f31c
......@@ -120,20 +120,22 @@ async def signin(request: Request, form_data: SigninForm):
user = Auths.authenticate_user_by_trusted_header(trusted_email)
else:
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 not Users.get_user_by_email(admin_email.lower()):
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"),
)
user = Auths.authenticate_user(admin_email.lower(), admin_password)
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
user = Auths.authenticate_user(form_data.email.lower(), form_data.password)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment