-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security/Http] Make UserValueResolver accept any subtype of UserInterface #30401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ public function __construct(TokenStorageInterface $tokenStorage) | |
public function supports(Request $request, ArgumentMetadata $argument) | ||
{ | ||
// only security user implementations are supported | ||
if (UserInterface::class !== $argument->getType()) { | ||
$type = $argument->getType(); | ||
if (UserInterface::class !== $type && !is_subclass_of($type, UserInterface::class)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if l48 should be changed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please test this with a parameter converter to see if this will work as expected when the UserInterface is an entity and parameter converters are enabled. |
||
return false; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated classes don't get new features, should be reverted