Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] #[CurrentUser] arguments should resolve to null for "anon."#40286
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ba4dd23 todc7942bCompare
jvasseur left a comment
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.
I think my goal was to support nullable arguments when no user are present but I forgot that anonymous users where strings and not null.
But I guess the nullable use case is already solved by theDefaultValueResolver so this is fine.
src/Symfony/Component/Security/Http/Controller/UserValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
dc7942b to8d3078dCompare
The UserValueResolver should only resolve
UserInterface(or subtype) typed arguments:symfony/src/Symfony/Component/Security/Http/Controller/UserValueResolver.php
Lines 54 to 55 inbc9e946
When using the
#CurrentUserattribute with an AnonymousToken in the storage, the resolved argument value isanon.. This PR fixes it./cc@jvasseur