"git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "fa892afcb9532fe559a067b49f31952c7a80c3c7"
Commit 26ee547f authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix

parent 01e020d1
...@@ -118,26 +118,24 @@ async def signin(request: Request, form_data: SigninForm): ...@@ -118,26 +118,24 @@ async def signin(request: Request, form_data: SigninForm):
), ),
) )
user = Auths.authenticate_user_by_trusted_header(trusted_email) user = Auths.authenticate_user_by_trusted_header(trusted_email)
else: elif WEBUI_AUTH == False:
if WEBUI_AUTH == False: admin_email = "admin@localhost"
admin_password = "admin"
admin_email = "admin@localhost"
admin_password = "admin"
if 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) user = Auths.authenticate_user(admin_email.lower(), admin_password)
else: else:
if Users.get_num_users() != 0: if Users.get_num_users() != 0:
raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS) raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS)
await signup( await signup(
request, request,
SignupForm(email=admin_email, password=admin_password, name="User"), 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: else:
user = Auths.authenticate_user(form_data.email.lower(), form_data.password) user = Auths.authenticate_user(form_data.email.lower(), form_data.password)
if user: if user:
token = create_token( token = create_token(
......
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