8000 bug #36650 [Security] Fix bug introduced in entry_point configuration… · symfony/symfony@c30d6f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c30d6f9

Browse files
committed
bug #36650 [Security] Fix bug introduced in entry_point configuration (#36575) (wouterj)
This PR was merged into the 5.1-dev branch. Discussion ---------- [Security] Fix bug introduced in entry_point configuration (#36575) | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 6978471 Fixed #36575
2 parents ed1b6ea + 6978471 commit c30d6f9

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