Fix panic on empty username for invites (#1334)

Validate email and user are not empty
This commit is contained in:
Maycon Santos
2023-11-28 13:09:33 +01:00
committed by GitHub
parent d1a323fa9d
commit dc05102b8f
2 changed files with 14 additions and 1 deletions

View File

@ -155,9 +155,14 @@ func (h *UsersHandler) CreateUser(w http.ResponseWriter, r *http.Request) {
email = *req.Email
}
name := ""
if req.Name != nil {
name = *req.Name
}
newUser, err := h.accountManager.CreateUser(account.Id, user.Id, &server.UserInfo{
Email: email,
Name: *req.Name,
Name: name,
Role: req.Role,
AutoGroups: req.AutoGroups,
IsServiceUser: req.IsServiceUser,