Conversation

94noni

I know its documented rapidly (via a code diff example) on top of this file
but here on a controller I thinks its more usefull rather than using the getUser of the abstract controller
wdyt?

also unrelated but, would it be possible to display the class name here ?
seeing only getUser can be misleading, what about Security::getUser
because getUser is globally generic in the codebase
Capture d’écran 2025-04-07 à 09 38 21

@@ -2100,6 +2101,11 @@ accessed via the ``getUser()`` shortcut in the
// For example, if you added a getFirstName() method, you can use that.
return new Response('Well hi there '.$user->getFirstName());
}

public function me(#[CurrentUser] User $user): Response
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about unauthenticated users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, should I add an IsGranted above the action? :)

Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.