Replies: 1 comment
-
@ThianHooi - What nestjs-query is offering are points to add authorization, not authentication. Authentication should be global to your app, theoretically. By that I mean, if you have users being authenticated, the whole app needs to be covered by your authentication guard (global) and then, depending on how the user authenticated (i.e. logged in or not) you allow access (which is then authorization). Scott |
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
-
I would like to add auth guards to certain graphql mutation, e.g. create or update in auto generated resolver. Please provide an example. Any help is greatly appreciated!
I found this section from the docs.
What I did are
readonly: true
guards: [JwtAuthGuard]
in the module (not sure if this is right)@Authorize(CustomAuthorizer)
on dtoBut this is for authorization, which is deciding who can access what data. I am trying to achieve authentication in selected operations or query.
Beta Was this translation helpful? Give feedback.
All reactions