8000 bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider · symfony/symfony@30a34b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30a34b0

Browse files
committed
bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
1 parent 7b0ed91 commit 30a34b0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function authenticate(TokenInterface $token)
5050
}
5151

5252
$user = $token->getUser();
53-
$this->userChecker->checkPostAuth($user);
53+
$this->userChecker->checkPreAuth($user);
5454

5555
$authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->key);
5656
$authenticatedToken->setAttributes($token->getAttributes());

src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Tests\Authentication\Provider;
1313

1414
use Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider;
15-
use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
15+
use Symfony\Component\Security\Core\Exception\DisabledException;
1616
use Symfony\Component\Security\Core\Role\Role;
1717

1818
class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
@@ -45,14 +45,14 @@ public function testAuthenticateWhenKeysDoNotMatch()
4545
}
4646

4747
/**
48-
* @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
48+
* @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
4949
*/
50-
public function testAuthenticateWhenPostChecksFails()
50+
public function testAuthenticateWhenPreChecksFails()
5151
{
5252
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
5353
$userChecker->expects($this->once())
54-
->method('checkPostAuth')
55-
->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\AccountExpiredException', null, array(), '')))
54+
->method('checkPreAuth')
55+
->will($this->throwException(new DisabledException()))
5656
;
5757

5858
$provider = $this->getProvider($userChecker);

0 commit comments

Comments
 (0)
0