8000 Fixed #36575 · symfony/symfony@6978471 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6978471

Browse files
authored
Fixed #36575
1 parent ed1b6ea commit 6978471

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,12 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
560560
if ($entryPoints) {
561561
// we can be sure the authenticator system is enabled
562562
if (null !== $defaultEntryPoint) {
563-
return $entryPoints[$defaultEntryPoint] ?? $defaultEntryPoint;
564-
}
565-
566-
if (1 === \count($entryPoints)) {
567-
return current($entryPoints);
563+
$defaultEntryPoint = $entryPoints[$defaultEntryPoint] ?? $defaultEntryPoint;
564+
} elseif (1 === \count($entryPoints)) {
565+
$defaultEntryPoint = current($entryPoints);
566+
} else {
567+
throw new InvalidConfigurationException(sprintf('Because you have multiple authenticators in firewall "%s", you need to set the "entry_point" key to one of your authenticators (%s) or a service ID implementing "%s". The "entry_point" determines what should happen (e.g. redirect to "/login") when an anonymous user tries to access a protected page.', $id, implode(', ', $entryPoints), AuthenticationEntryPointInterface::class));
568568
}
569-
570-
throw new InvalidConfigurationException(sprintf('Because you have multiple authenticators in firewall "%s", you need to set the "entry_point" key to one of your authenticators (%s) or a service ID implementing "%s". The "entry_point" determines what should happen (e.g. redirect to "/login") when an anonymous user tries to access a protected page.', $id, implode(', ', $entryPoints), AuthenticationEntryPointInterface::class));
571569
}
572570

573571
if (false === $hasListeners) {

0 commit comments

Comments
 (0)
0