Add secure authentication and authorization to your Reading Tracker API. Implement user registration, login with JWT, and role-based access control to protect routes and enable admin-level actions for a production-ready backend.
Overview
Syllabus
- Unit 1: User Registration with Hashing
- Exploring Secure User Registration
- Implementing Secure User Registration in NestJS
- Implementing JWT Strategy and Auth Module
- Building Auth Service and Controller
- Unit 2: JWT Login and Token Issuance
- Observing JWT Login and Token Issuance
- Adding Login Endpoint to Auth Controller
- Implementing Login Logic in Auth Service
- Implementing a User Profile Endpoint
- Unit 3: Protecting Routes with AuthGuard
- Observing Route Protection with AuthGuard
- Applying AuthGuard Decorators to Controllers
- Creating the "Me" Route with AuthGuard
- Unit 4: Role-Based Authorization
- Observing Role-Based Authorization with Guards and Decorators
- Implementing the @Roles() Decorator
- Applying AuthGuard and RolesGuard to Controllers
- Implementing Role-Based Authorization in NestJS