payload icon indicating copy to clipboard operation
payload copied to clipboard

docs: add payload.auth to local api

Open HarleySalas opened this issue 2 months ago • 0 comments

What?

https://payloadcms.com/docs does not document the payload.auth feature.

Why?

With custom components, there is no explanation as to how you can get the current user on the server side. It is also something useful to know for many other scenarios. A Discord user even mentioned today, that they spent quite some time, trying to figure out how to get the current user, while on the server.

While I don't think it's the cleanest "place" to document it, I think its what makes the most sense, given the current state of the documentation. I tried to follow the existing format as close as possible. The comments are longer, but I feel the information is absolutely necessary to provide.

Confirmed that formatting works as expected and there are no errors parsing the addition: image

Fixes #9631

HarleySalas avatar Nov 30 '24 18:11 HarleySalas