Skip to content

Commit ee5b6aa

Browse files
author
PhilVanB
committed
Fix UserNotFoundException
1 parent 60705b2 commit ee5b6aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Security/LdapUserProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Ldap\Adapter\QueryInterface;
66
use Symfony\Component\Ldap\Entry;
77
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
8-
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
8+
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
99
use Symfony\Component\Security\Core\User\UserInterface;
1010
use Symfony\Component\Security\Core\User\UserProviderInterface;
1111
use Mapbender\LDAPBundle\Security\LdapClient;
@@ -65,7 +65,7 @@ public function loadUserByIdentifier(string $username): UserInterface
6565
// skips to the next provider, if any
6666
/** @see \Symfony\Component\Security\Core\User\ChainUserProvider::loadUserByUsername() */
6767
if (!$this->client->getHost()) {
68-
throw new UsernameNotFoundException('LDAP lookup disabled with empty host configuration', 0);
68+
throw new UserNotFoundException('LDAP lookup disabled with empty host configuration', 0);
6969
}
7070

7171
$this->client->bind();
@@ -76,7 +76,7 @@ public function loadUserByIdentifier(string $username): UserInterface
7676
$roles = $this->findLdapUserRoles($results[0]);
7777
return new LdapUser($username, $roles);
7878
} else {
79-
throw new UsernameNotFoundException(sprintf('User "%s" could not be fetched from LDAP.', $username), 0);
79+
throw new UserNotFoundException(sprintf('User "%s" could not be fetched from LDAP.', $username), 0);
8080
}
8181
}
8282

0 commit comments

Comments
 (0)