CodeWithJay

NestJS Auth Part 3: Roles Decorator, RolesGuard and Seller-Only Routes: E9

19 min811 views

NestJS Auth Part 3: Roles Decorator, RolesGuard and Seller-Only Routes: E9

About this video

A buyer should not be able to create products, and right now ours can. This episode finishes the auth trilogy with role-based access control.

We build the Roles decorator and a RolesGuard powered by Reflector, add the OptionalJwtAuthGuard for routes that personalize when you are logged in but still work when you are not, and stack seller-only guards on product create, update, and the seller listing route.

Subscribe to Code with Jay to follow the full build.

Keep learning NestJS

Every free video, mini course and project-based course on NestJS in one place, in the order that makes sense.

All videos