review: ldap search user

This commit is contained in:
Daniel Ding
2022-09-02 15:26:21 +00:00
parent 5a7872db0c
commit b8b5ec1467

View File

@@ -56,8 +56,8 @@ func (l *LDAPService) Login(userName, password string) (bool, error) {
if err != nil {
return false, err
}
if len(result.Entries) != 1 {
return false, fmt.Errorf("invalid users")
if len(result.Entries) < 0 {
return false, fmt.Errorf("user not found")
}
obj := result.Entries[0]
Debug("LDAPService.Login %v", obj)