fix: don't allow UserCreate endpoint if no basic auth enabled (#1861)

This commit is contained in:
abelanger5
2025-06-13 14:30:45 -04:00
committed by GitHub
parent 4348dc99e5
commit f86eccfd9f

View File

@@ -16,6 +16,12 @@ import (
)
func (u *UserService) UserCreate(ctx echo.Context, request gen.UserCreateRequestObject) (gen.UserCreateResponseObject, error) {
// check that the server supports local registration
if !u.config.Auth.ConfigFile.BasicAuthEnabled {
return gen.UserCreate405JSONResponse(
apierrors.NewAPIErrors("local registration is not enabled"),
), nil
}
if !u.config.Runtime.AllowSignup {
return gen.UserCreate400JSONResponse(