mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-03 07:47:54 +02:00
Merge pull request #5020 from stonezdj/fix_login_500
Fix error 500 with error username
This commit is contained in:
commit
2844d137d3
@ -58,9 +58,6 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) {
|
|||||||
defer ldapSession.Close()
|
defer ldapSession.Close()
|
||||||
|
|
||||||
ldapUsers, err := ldapSession.SearchUser(p)
|
ldapUsers, err := ldapSession.SearchUser(p)
|
||||||
|
|
||||||
log.Debugf("Found ldap user %+v", ldapUsers[0])
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("ldap search fail: %v", err)
|
log.Warningf("ldap search fail: %v", err)
|
||||||
return nil, 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.")
|
log.Warningf("Found more than one entry.")
|
||||||
return nil, auth.NewErrAuth("Multiple entries found")
|
return nil, auth.NewErrAuth("Multiple entries found")
|
||||||
}
|
}
|
||||||
|
log.Debugf("Found ldap user %+v", ldapUsers[0])
|
||||||
|
|
||||||
u := models.User{}
|
u := models.User{}
|
||||||
u.Username = ldapUsers[0].Username
|
u.Username = ldapUsers[0].Username
|
||||||
|
Loading…
Reference in New Issue
Block a user