diff --git a/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php b/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php index 21bd1bc1cdb0..a6718a723282 100644 --- a/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php @@ -168,7 +168,7 @@ private function attemptSwitchUser(Request $request, string $username): ?TokenIn try { $this->provider->loadUserByUsername($nonExistentUsername); - } catch (AuthenticationException $e) { + } catch (\Exception $e) { } } catch (AuthenticationException $e) { $this->provider->loadUserByUsername($currentUsername);