Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
01e020d1
Commit
01e020d1
authored
May 08, 2024
by
Timothy J. Baek
Browse files
fix
parent
88e8f31c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
backend/apps/web/routers/auths.py
backend/apps/web/routers/auths.py
+7
-5
No files found.
backend/apps/web/routers/auths.py
View file @
01e020d1
...
@@ -120,20 +120,22 @@ async def signin(request: Request, form_data: SigninForm):
...
@@ -120,20 +120,22 @@ 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
:
else
:
if
WEBUI_AUTH
==
False
:
if
WEBUI_AUTH
==
False
:
if
Users
.
get_num_users
()
!=
0
:
raise
HTTPException
(
400
,
detail
=
ERROR_MESSAGES
.
EXISTING_USERS
)
admin_email
=
"admin@localhost"
admin_email
=
"admin@localhost"
admin_password
=
"admin"
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
(
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment