Skip to content

Commit 8c98647

Browse files
authored
Added descriptive exception when using Guards and the authenticator system
1 parent 8b5dfb9 commit 8c98647

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public function create(ContainerBuilder $container, string $id, array $config, s
9999

100100
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId)
101101
{
102+
if (!class_exists(GuardBridgeAuthenticator::class)) {
103+
throw new \LogicException('Package "symfony/security-guard" must be version 5.1 or higher in order to use the authenticator security system.');
104+
}
105+
102106
$userProvider = new Reference($userProviderId);
103107
$authenticatorIds = [];
104108

0 commit comments

Comments
 (0)