Skip to content

Commit

Permalink
ldap: setup a new ldap conn on bind failure
Browse files Browse the repository at this point in the history
  • Loading branch information
rchincha committed Nov 8, 2019
1 parent 2436136 commit 13a8d86
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 13a8d86

Please sign in to comment.