|
@@ -195,7 +195,11 @@ 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 request.app.state.config.ENABLE_SIGNUP and WEBUI_AUTH:
|
|
|
|
|
|
+ if (
|
|
|
|
+ not request.app.state.config.ENABLE_SIGNUP
|
|
|
|
+ and request.app.state.config.ENABLE_LOGIN_FORM
|
|
|
|
+ and WEBUI_AUTH
|
|
|
|
+ ):
|
|
raise HTTPException(
|
|
raise HTTPException(
|
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
|
|
)
|
|
)
|
|
@@ -228,7 +232,6 @@ async def signup(request: Request, response: Response, form_data: SignupForm):
|
|
data={"id": user.id},
|
|
data={"id": user.id},
|
|
expires_delta=parse_duration(request.app.state.config.JWT_EXPIRES_IN),
|
|
expires_delta=parse_duration(request.app.state.config.JWT_EXPIRES_IN),
|
|
)
|
|
)
|
|
- # response.set_cookie(key='token', value=token, httponly=True)
|
|
|
|
|
|
|
|
# Set the cookie token
|
|
# Set the cookie token
|
|
response.set_cookie(
|
|
response.set_cookie(
|