|
Post by mittu2222 on Dec 20, 2023 9:56:02 GMT
Validation & Transformation PART 3 Building a REST API with NestJS and Prisma: Error Handling PART 4 Building a REST API with NestJS and Prisma: Handling Relational Data PART 5 (Currently reading) Building a REST API with NestJS and Prisma: Authentication Table Of Contents Introduction Development environment Clone the repository Project structure and files Implement authentication in your REST API Install and configure passport Implement a POST /auth/login endpoint Implement JWT authentication strategy. Implement JWT auth guard Integr photo editing servies ate authentication in Swagger Hashing passwords Summary and final remarks Introduction In the previous chapter of this series, you learned how to handle relational data in your NestJS REST API. You created a User model and added a one-to-many relationship between User and Article models. You also implemented the CRUD endpoints for the User model. In this chapter, you will learn how to add authentication to your API using a package called Passport: First, you. will implement JSON Web Token (JWT) based authentication using a library called Passport. Next, you will protect the passwords stored in your database by hashing them using the bcrypt library. In this tutorial, you will use the API built in the last chapter. Development environment To follow along with this tutorial, you will be expected to: have Node.js installed.installed. If you are using Linux, please make sure your Docker version is or higher. You can check your Docker.
|
|