#✅ Get the current user inside a custom endpoint

5 messages · Page 1 of 1 (latest)

devout grail
#

Hello everyone !

I'm looking for a way to access the current user making the request inside a custom endpoint, my goal is to get the id so i can assign a post to a user, is there a "Directus way" ?

Thank you !

abstract girderBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

rich lynx
#

If the request is authenticated (if not there is not "current user") you can get that from req.accountability.user.

devout grail
#

Thank you !

abstract girderBOT
#

✅ Get the current user inside a custom endpoint