Fix exception when the password of a valid ldap user is invalid
This commit is contained in:
parent
8e645d0410
commit
0b28bd31e5
|
@ -159,15 +159,12 @@ class LdapUserBackend implements UserBackend
|
|||
*/
|
||||
public function authenticate(Credential $credentials)
|
||||
{
|
||||
if (!$this->connection->testCredentials(
|
||||
if ($this->connection->testCredentials(
|
||||
$this->connection->fetchDN($this->selectUsername($credentials->getUsername())),
|
||||
$credentials->getPassword()
|
||||
)) {
|
||||
return false;
|
||||
return new User($credentials->getUsername());
|
||||
}
|
||||
$user = new User($credentials->getUsername());
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue