Closed crivera closed 4 years ago
Sorry for the incredibly late reply, I've been busy with other things. I think it would definitely be worth adding an example of role-based authentication to this project, I'll look into it.
For now, this tutorial shows how to implement Auth0 role guards in NestJS https://auth0.com/blog/developing-a-secure-api-with-nestjs-adding-role-based-access-control/
Unfortunately, I don't have time to do this atm. If anyone wants to add roles to this example, I'll accept a pull request but, for now, I will close this issue.
Hi
I saw your project and preferred it over using an express middleware as described in other Auth0 tutorials.
I am very new with NestJS but do you know a way of adding a Role to the AuthGuard.
So that I could annotate it like
@AuthGuard('ADMIN')
and in theJwtStrategy.validate()
could check the roles against the passed in role?Thanks for your project though! Very nice