Skip to content

Commit 7dc4135

Browse files
committed
[cookbook][custom_auth] Fixing cookbook entry to create a fresh, authenticated token. See symfony#614
1 parent 899f342 commit 7dc4135

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎cookbook/security/custom_authentication_provider.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ the ``PasswordDigest`` header value matches with the user's password.
201201
{
202202
$user = $this->userProvider->loadUserByUsername($token->getUsername());
203203
204-
if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) {
205-
$token->setUser($user);
204+
if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) {
205+
$authenticatedToken = new WsseUserToken($user->getRoles());
206+
$authenticatedToken->setUser($user);
207+
206208
return $token;
207209
}
208210

0 commit comments

Comments
 (0)
X