mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
refac: automatically disable new sign ups after first user
This commit is contained in:
parent
503019b28d
commit
98cea8aaa4
1 changed files with 5 additions and 0 deletions
|
|
@ -260,6 +260,11 @@ async def signup(request: Request, response: Response, form_data: SignupForm):
|
|||
if Users.get_num_users() == 0
|
||||
else request.app.state.config.DEFAULT_USER_ROLE
|
||||
)
|
||||
|
||||
if Users.get_num_users() == 0:
|
||||
# Disable signup after the first user is created
|
||||
request.app.state.config.ENABLE_SIGNUP = False
|
||||
|
||||
hashed = get_password_hash(form_data.password)
|
||||
user = Auths.insert_new_auth(
|
||||
form_data.email.lower(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue