Skip to content

Commit 6e1af48

Browse files
GromNaNfabpot
authored andcommitted
Hide sensitive information with SensitiveParameter attribute
1 parent 05bf1b5 commit 6e1af48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function deleteTokenBySeries(string $series)
8787
/**
8888
* {@inheritdoc}
8989
*/
90-
public function updateToken(string $series, string $tokenValue, \DateTime $lastUsed)
90+
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
9191
{
9292
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
9393
$paramValues = [
@@ -140,7 +140,7 @@ public function createNewToken(PersistentTokenInterface $token)
140140
/**
141141
* {@inheritdoc}
142142
*/
143-
public function verifyToken(PersistentTokenInterface $token, string $tokenValue): bool
143+
public function verifyToken(PersistentTokenInterface $token, #[\SensitiveParameter] string $tokenValue): bool
144144
{
145145
// Check if the token value matches the current persisted token
146146
if (hash_equals($token->getTokenValue(), $tokenValue)) {
@@ -177,7 +177,7 @@ public function verifyToken(PersistentTokenInterface $token, string $tokenValue)
177177
/**
178178
* {@inheritdoc}
179179
*/
180-
public function updateExistingToken(PersistentTokenInterface $token, string $tokenValue, \DateTimeInterface $lastUsed): void
180+
public function updateExistingToken(PersistentTokenInterface $token, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void
181181
{
182182
if (!$token instanceof PersistentToken) {
183183
return;

0 commit comments

Comments
 (0)