Skip to content

How to implement custom authorization decorators #1000

Answered by MichalLytek
blevine asked this question in Q&A
Discussion options

You must be logged in to vote

@blevine You can use the authChecker solution with passing functions as arguments to @Authorized().

The alternative solution would be to use custom method decorators and middlewares to pass functions as arguments into a generic function which will throw error or call next():
https://typegraphql.com/docs/custom-decorators.html#method-decorators

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@blevine
Comment options

Answer selected by blevine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants