Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c616e2c

Browse files
committed
bug #47335 [Security] [AbstractToken] getUserIdentifier() must return a string (mpiot)
This PR was submitted for the 6.2 branch but it was merged into the 6.0 branch instead. Discussion ---------- [Security] [AbstractToken] getUserIdentifier() must return a string | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Fix the `getUserIdentifier()` method from Symfony\Component\Security\Core\Authentication\Token\AbstractToken, he method must return a string, but based on a nullable UserInterface object. Commits ------- 2987d58 [Security][AbstractToken] getUserIdentifier() must return a string
2 parents 527b6a9 + 2987d58 commit c616e2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getRoleNames(): array
4848

4949
public function getUserIdentifier(): string
5050
{
51-
return $this->user->getUserIdentifier();
51+
return $this->user ? $this->user->getUserIdentifier() : '';
5252
}
5353

5454
/**

0 commit comments

Comments
 (0)