Skip to content

Commit

Permalink
fix(security): user programatic login with dedicated user checker on …
Browse files Browse the repository at this point in the history
…firewall
  • Loading branch information
94noni committed Mar 14, 2024
1 parent e49f84b commit 8d60c6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Symfony/Bundle/SecurityBundle/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ public function login(UserInterface $user, ?string $authenticatorName = null, ?s

$authenticator = $this->getAuthenticator($authenticatorName, $firewallName);

$this->container->get('security.user_checker')->checkPreAuth($user);

if ($this->container->has('security.user_checker.'$firewallName)) {
$this->container->get('security.user_checker.'$firewallName)->checkPreAuth($user);
} else {
$this->container->get('security.user_checker')->checkPreAuth($user);
}

return $this->container->get('security.authenticator.managers_locator')->get($firewallName)->authenticateUser($user, $authenticator, $request, $badges);
}
Expand Down

0 comments on commit 8d60c6a

Please sign in to comment.