Skip to content

Commit ad6a2be

Browse files
[Messenger][Security/Core] Remove legacy class aliases
1 parent 76e8bd6 commit ad6a2be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Authentication/AuthenticatorManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2323
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
2424
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
25-
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
25+
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
2626
use Symfony\Component\Security\Core\User\UserInterface;
2727
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
2828
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
@@ -261,7 +261,7 @@ private function handleAuthenticationFailure(AuthenticationException $authentica
261261

262262
// Avoid leaking error details in case of invalid user (e.g. user not found or invalid account status)
263263
// to prevent user enumeration via response content comparison
264-
if ($this->hideUserNotFoundExceptions && ($authenticationException instanceof UsernameNotFoundException || ($authenticationException instanceof AccountStatusException && !$authenticationException instanceof CustomUserMessageAccountStatusException))) {
264+
if ($this->hideUserNotFoundExceptions && ($authenticationException instanceof UserNotFoundException || ($authenticationException instanceof AccountStatusException && !$authenticationException instanceof CustomUserMessageAccountStatusException))) {
265265
$authenticationException = new BadCredentialsException('Bad credentials.', 0, $authenticationException);
266266
}
267267

Authenticator/RememberMeAuthenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2121
use Symfony\Component\Security\Core\Exception\CookieTheftException;
2222
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
23-
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
23+
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
2424
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
2525
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
2626
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
@@ -108,7 +108,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
108108
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
109109
{
110110
if (null !== $this->logger) {
111-
if ($exception instanceof UsernameNotFoundException) {
111+
if ($exception instanceof UserNotFoundException) {
112112
$this->logger->info('User for remember-me cookie not found.', ['exception' => $exception]);
113113
} elseif ($exception instanceof UnsupportedUserException) {
114114
$this->logger->warning('User class for remember-me cookie not supported.', ['exception' => $exception]);

0 commit comments

Comments
 (0)