diff --git a/backend/app/api/handlers/v1/v1_ctrl_user.go b/backend/app/api/handlers/v1/v1_ctrl_user.go index 565a723..c70672f 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_user.go +++ b/backend/app/api/handlers/v1/v1_ctrl_user.go @@ -1,6 +1,7 @@ package v1 import ( + "fmt" "net/http" "github.com/google/uuid" @@ -27,8 +28,8 @@ func (ctrl *V1Controller) HandleUserRegistration() server.HandlerFunc { return validate.NewRequestError(err, http.StatusInternalServerError) } - if !ctrl.allowRegistration && regData.GroupToken == "" { - return validate.NewRequestError(nil, http.StatusForbidden) + if ctrl.allowRegistration == false && regData.GroupToken == "" { + return validate.NewRequestError(fmt.Errorf("user registration disabled"), http.StatusForbidden) } _, err := ctrl.svc.User.RegisterUser(r.Context(), regData)