Developing a Secure API with NestJS

Thought the article was great! When I first attempted at setting up Auth0 with NestJS I couldn’t find anything, so I ended up having to work it out myself (also at the time the pull request to integrate jwks-rsa with passport-jwt was still in the works), and an article like this would have been really helpful. I had a couple of questions:

Questions

  1. Would it be possible to check the roles/permissions against the @Permissions metadata within the validate method of the first JwtStrategy AuthGuard?
  2. Why use dotenv instead of @nestjs/config (NestJS’s configuration package which utilises dotenv under the hood).

Anyway, thanks for the great tutorial. I’m currently using some ideas from it to add to my nestjs-auth0 example/starter repo.

2 Likes