10000 [Security] added userChecker to SimpleAuthenticationProvider · symfony/symfony@974acb9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 974acb9

Browse files
committed
[Security] added userChecker to SimpleAuthenticationProvider
apply userChecker after authToken is authenticated
1 parent 63d9dce commit 974acb9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ public function __construct(SimpleAuthenticatorInterface $simpleAuthenticator, U
3939
public function authenticate(TokenInterface $token)
4040
{
4141
$authToken = $this->simpleAuthenticator->authenticateToken($token, $this->userProvider, $this->providerKey);
42-
$this->userChecker->checkPreAuth($authToken->getUser());
43-
$this->userChecker->checkPostAuth($authToken->getUser());
4442

4543
if ($authToken instanceof TokenInterface) {
44+
$this->userChecker->checkPreAuth($authToken->getUser());
45+
$this->userChecker->checkPostAuth($authToken->getUser());
46+
4647
return $authToken;
4748
}
4849

50+
$this->userChecker->checkPreAuth($authToken->getUser());
51+
$this->userChecker->checkPostAuth($authToken->getUser());
52+
4953
throw new AuthenticationException('Simple authenticator failed to return an authenticated token.');
5054
}
5155

0 commit comments

Comments
 (0)
0