Fix error management on user creation.

pull/23/head
pebles 12 months ago
parent 43fafbcf6b
commit 3f939af80c
Signed by: pebles
GPG Key ID: 4501C52A9268B49C
  1. 3
      server/add_user.go

@ -187,11 +187,12 @@ func (s *server) addUserHandler(w http.ResponseWriter, r *http.Request) {
if !errors.Is(err, ldap.ErrNotFound) {
log.Println("Can't create user ", name, ": already exists")
response.execute("exists")
return
} else {
// ErrNotFound (user doesn't exist): Here it's not an error, we can create user.
log.Println("Error getting user: ", err)
s.errorHandler(w, r)
}
return
}
err = s.ldap.AddGroup(name, "")

Loading…
Cancel
Save