mirror of
https://github.com/open-webui/open-webui
synced 2025-02-18 19:08:42 +00:00
Merge pull request #5576 from open-webui/dev
fix: WEBUI_AUTH=False not working issue
This commit is contained in:
commit
f47dffe6e1
@ -188,14 +188,19 @@ async def signin(request: Request, response: Response, form_data: SigninForm):
|
|||||||
|
|
||||||
@router.post("/signup", response_model=SigninResponse)
|
@router.post("/signup", response_model=SigninResponse)
|
||||||
async def signup(request: Request, response: Response, form_data: SignupForm):
|
async def signup(request: Request, response: Response, form_data: SignupForm):
|
||||||
if (
|
if WEBUI_AUTH:
|
||||||
not request.app.state.config.ENABLE_SIGNUP
|
if (
|
||||||
or not request.app.state.config.ENABLE_LOGIN_FORM
|
not request.app.state.config.ENABLE_SIGNUP
|
||||||
or not WEBUI_AUTH
|
or not request.app.state.config.ENABLE_LOGIN_FORM
|
||||||
):
|
):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
if Users.get_num_users() != 0:
|
||||||
|
raise HTTPException(
|
||||||
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
||||||
|
)
|
||||||
|
|
||||||
if not validate_email_format(form_data.email.lower()):
|
if not validate_email_format(form_data.email.lower()):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
Loading…
Reference in New Issue
Block a user