mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 16:50:27 +00:00
fix user registration bug
This commit is contained in:
parent
dfdf98c82b
commit
25ef2d0f51
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
@ -27,8 +28,8 @@ func (ctrl *V1Controller) HandleUserRegistration() server.HandlerFunc {
|
||||||
return validate.NewRequestError(err, http.StatusInternalServerError)
|
return validate.NewRequestError(err, http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ctrl.allowRegistration && regData.GroupToken == "" {
|
if ctrl.allowRegistration == false && regData.GroupToken == "" {
|
||||||
return validate.NewRequestError(nil, http.StatusForbidden)
|
return validate.NewRequestError(fmt.Errorf("user registration disabled"), http.StatusForbidden)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := ctrl.svc.User.RegisterUser(r.Context(), regData)
|
_, err := ctrl.svc.User.RegisterUser(r.Context(), regData)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue