Skip to content

Commit

Permalink
Merge pull request #35 from rchincha/ldap
Browse files Browse the repository at this point in the history
ldap: setup a new ldap conn on bind failure
  • Loading branch information
tych0 authored Nov 8, 2019
2 parents 2436136 + 13a8d86 commit 0550752
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/api/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func (lc *LDAPClient) Authenticate(username, password string) (bool, map[string]
err := lc.Conn.Bind(lc.BindDN, lc.BindPassword)
if err != nil {
lc.log.Error().Err(err).Str("bindDN", lc.BindDN).Msg("bind failed")
// clean up the cached conn, so we can retry
lc.Conn.Close()
lc.Conn = nil
return false, nil, err
}
}
Expand Down

0 comments on commit 0550752

Please sign in to comment.