mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-23 23:31:33 +01:00
Fix error 500 with error username
This commit is contained in:
parent
d16cddda04
commit
a1b668921b
@ -58,9 +58,6 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) {
|
||||
defer ldapSession.Close()
|
||||
|
||||
ldapUsers, err := ldapSession.SearchUser(p)
|
||||
|
||||
log.Debugf("Found ldap user %+v", ldapUsers[0])
|
||||
|
||||
if err != nil {
|
||||
log.Warningf("ldap search fail: %v", err)
|
||||
return nil, err
|
||||
@ -73,6 +70,7 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) {
|
||||
log.Warningf("Found more than one entry.")
|
||||
return nil, auth.NewErrAuth("Multiple entries found")
|
||||
}
|
||||
log.Debugf("Found ldap user %+v", ldapUsers[0])
|
||||
|
||||
u := models.User{}
|
||||
u.Username = ldapUsers[0].Username
|
||||
|
Loading…
Reference in New Issue
Block a user