Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj authored and vjandrea committed May 3, 2020
1 parent 77a47d0 commit 6f41c2d
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,12 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
if ($entryPoints) {
// we can be sure the authenticator system is enabled
if (null !== $defaultEntryPoint) {
return $entryPoints[$defaultEntryPoint] ?? $defaultEntryPoint;
}

if (1 === \count($entryPoints)) {
return current($entryPoints);
$defaultEntryPoint = $entryPoints[$defaultEntryPoint] ?? $defaultEntryPoint;
} elseif (1 === \count($entryPoints)) {
$defaultEntryPoint = current($entryPoints);
} else {
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));
}

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));
}

if (false === $hasListeners) {
Expand Down

0 comments on commit 6f41c2d

Please sign in to comment.