mirror of
https://github.com/luscis/openlan.git
synced 2025-10-24 17:30:57 +08:00
review: ldap search user
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user