How can get user info who is calling an API from frontend

Hi,
I am passing userId to an API that creates an entity, but I do not know if the current user’s ID is the same as the ID passed in. can any one help?

Thanks
John

You can find information about the current user in context. Maybe have a look at this post at these docs Services | RedwoodJS Docs and GraphQL | RedwoodJS Docs.

If you are trying to do some sort of validation as to if a user can edit a post they own try having a read of this discussion Must be post owner to delete post.

Do those solve your problem?

2 Likes

Thank you so much!