Skip to content

Commit 18c5efb

Browse files
Fix the previously broken test
This commit adds a fix to the test that was introduced before and that broke the build. When a custom TokenVerifier is used, the provided token might not be the same as the expected token. But the provided token will later be added to the Cookie which results in a broken cookie. By replacing the provided token with the actually expected one from the persistence layer this is fixed. This will still not solve concurrency issues where two parallel requests with any token will currently result in two different tokens being created for the same family but that is something else that needs to be discussed first.
1 parent f3ca91f commit 18c5efb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function processRememberMe(RememberMeDetails $rememberMeDetails, UserInte
7575

7676
if ($this->tokenVerifier) {
7777
$isTokenValid = $this->tokenVerifier->verifyToken($persistentToken, $tokenValue);
78+
$tokenValue = $persistentToken->getTokenValue();
7879
} else {
7980
$isTokenValid = hash_equals($persistentToken->getTokenValue(), $tokenValue);
8081
}

0 commit comments

Comments
 (0)