mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
ldap: setup a new ldap conn on bind failure
This commit is contained in:
parent
24361364a7
commit
13a8d8631e
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue