mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
fix: WEBUI_AUTH=False not working issue
This commit is contained in:
parent
2f028b45fe
commit
9126ceac08
1 changed files with 13 additions and 8 deletions
|
|
@ -188,10 +188,15 @@ 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 not WEBUI_AUTH:
|
||||||
|
if Users.get_num_users() != 0:
|
||||||
|
raise HTTPException(
|
||||||
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
||||||
|
)
|
||||||
|
else:
|
||||||
if (
|
if (
|
||||||
not request.app.state.config.ENABLE_SIGNUP
|
not request.app.state.config.ENABLE_SIGNUP
|
||||||
or not request.app.state.config.ENABLE_LOGIN_FORM
|
or not request.app.state.config.ENABLE_LOGIN_FORM
|
||||||
or not WEBUI_AUTH
|
|
||||||
):
|
):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue