Skip to content

Commit 498000e

Browse files
committed
[Security] Workaround segfault
1 parent aaa821b commit 498000e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2222
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
2323
use Symfony\Component\Security\Core\Exception\AuthenticationException;
24-
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
2524
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
2625
use Symfony\Component\Security\Core\User\UserProviderInterface;
2726
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
@@ -85,8 +84,10 @@ public function authenticate(Request $request): Passport
8584
throw $e;
8685
}
8786

87+
$userBadge = new UserBadge($credentials['username'], $this->userProvider->loadUserByIdentifier(...));
88+
8889
$passport = new Passport(
89-
new UserBadge($credentials['username'], $this->userProvider->loadUserByIdentifier(...)),
90+
$userBadge,
9091
new PasswordCredentials($credentials['password'])
9192
);
9293
if ($this->userProvider instanceof PasswordUpgraderInterface) {

0 commit comments

Comments
 (0)