Commit 7e23df34 authored by ale's avatar ale

Only log unexpected LDAP errors

parent c91bff9f
......@@ -254,7 +254,10 @@ func (b *ldapServiceBackend) userFromResponse(username string, result *ldap.Sear
func (b *ldapServiceBackend) GetUser(ctx context.Context, name string) (*backend.User, bool) {
result, err := b.pool.Search(ctx, b.searchRequest(name))
if err != nil {
log.Printf("LDAP error: %v", err)
// Only log unexpected errors.
if !ldap.IsErrorWithCode(err, ldap.LDAPResultNoSuchObject) {
log.Printf("LDAP error: %v", err)
return nil, false
return b.userFromResponse(name, result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment