Replies: 1 comment
-
You need to pass the context around, there is no other way around it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I need to get the currently authenticated user (from a JWT passed in a authorization header), outside of my GraphQL resolvers.
I have something like this:
I've overridden my ORMs findAll method to do some authorization checks to fetch only specific permissions by taking in consideration the authenticated user. The thing is now I'm outside of my resolver, but want to access the user. An easy fix would just to pass the context to my function and be done with it, but I have other use cases where I would find it beneficial to simply be able to get the authenticated user instead of passing the context down everytime.
I've looked at this part in the docs about authorization outside of graphql, but in my case it's not the be used inside a REST endpoint.
Beta Was this translation helpful? Give feedback.
All reactions