Skip to content

Commit 04b27a5

Browse files
committed
Fixes: register compiler pass, fix tests
1 parent 6795578 commit 04b27a5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function verifyToken(PersistentTokenInterface $token, string $tokenValue)
175175
}
176176

177177
/**
178-
* {@inheritDoc}
178+
* {@inheritdoc}
179179
*/
180180
public function updateExistingToken(PersistentTokenInterface $token, string $tokenValue, \DateTimeInterface $lastUsed): void
181181
{

src/Symfony/Bridge/Doctrine/Tests/Security/RememberMe/DoctrineTokenProviderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testVerifyOutdatedTokenAfterParallelRequest()
6969

7070
// new request comes in requiring remember-me auth, which updates the token
7171
$provider->updateExistingToken($token, $newValue, new \DateTime('-5 seconds'));
72-
$provider->updateToken($token, $newValue, new \DateTime('-5 seconds'));
72+
$provider->updateToken($series, $newValue, new \DateTime('-5 seconds'));
7373

7474
// parallel request comes in with the old remember-me cookie and session, which also requires reauth
7575
$token = $provider->loadTokenBySeries($series);
@@ -94,7 +94,7 @@ public function testVerifyOutdatedTokenAfterParallelRequestFailsAfter60Seconds()
9494

9595
// new request comes in requiring remember-me auth, which updates the token
9696
$provider->updateExistingToken($token, $newValue, new \DateTime('-61 seconds'));
97-
$provider->updateToken($token, $newValue, new \DateTime('-5 seconds'));
97+
$provider->updateToken($series, $newValue, new \DateTime('-5 seconds'));
9898

9999
// parallel request comes in with the old remember-me cookie and session, which also requires reauth
100100
$token = $provider->loadTokenBySeries($series);

src/Symfony/Bundle/SecurityBundle/SecurityBundle.php

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass;
1515
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSecurityVotersPass;
1616
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSessionDomainConstraintPass;
17+
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\CleanRememberMeVerifierPass;
1718
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterCsrfFeaturesPass;
1819
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterEntryPointPass;
1920
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterGlobalSecurityEventListenersPass;
@@ -85,6 +86,7 @@ public function build(ContainerBuilder $container)
8586
// execute after ResolveChildDefinitionsPass optimization pass, to ensure class names are set
8687
$container->addCompilerPass(new SortFirewallListenersPass(), PassConfig::TYPE_BEFORE_REMOVING);
8788
$container->addCompilerPass(new ReplaceDecoratedRememberMeHandlerPass(), PassConfig::TYPE_OPTIMIZE);
89+
$container->addCompilerPass(new CleanRememberMeVerifierPass(), PassConfig::TYPE_BEFORE_REMOVING);
8890

8991
$container->addCompilerPass(new AddEventAliasesPass(array_merge(
9092
AuthenticationEvents::ALIASES,

0 commit comments

Comments
 (0)