Replies: 3 comments 3 replies
-
On principle, I agree with the idea here. But, would this also affect |
Beta Was this translation helpful? Give feedback.
-
#58007 has been merged now. |
Beta Was this translation helpful? Give feedback.
-
With this mapping: /** @var non-empty-string $token */
#[ORM\Column]
#[Assert\NotBlank]
private string $token; PHPStan is now complaining:
Did you find a way around this, or are you just |
Beta Was this translation helpful? Give feedback.
-
Some built-in authenticators already forbid using an empty user identifier, and I think this is an edge case that should not be supported.
I would add a
@return non-empty-string
annotation toUserInterface::getUserIdentifier
. Then, I would add a check inUserBadge::__construct
that would trigger a deprecation in 7.x and throw aBadCredentialsException
in 8.x if an empty user identifier is received.WDYT?
Built-in authenticators checking for empty user identifier
symfony/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php
Lines 130 to 132 in ca1f528
symfony/src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php
Lines 149 to 151 in ca1f528
See #58007
Beta Was this translation helpful? Give feedback.
All reactions