To finalize the project with JWT you need to add the proper code, in this video join Emmanuel Henri to test the finalized API with JWT.
- [Instructor] Now let's go ahead … and test our implementation and do it in Postman. … So the first thing we're going to do … is make sure our server is running … so I'm going to do npm start. … And if you see any error messages … because you made some typos … or there's something that's missing, … read the console for the error messages … and go back to those videos … just to make sure. … All right, so let's switch to Postman. … So the first thing we're going to do … is try to get the list of contacts … without entering any token … as if we're unauthorized. … So let's go ahead and do that. … So let's send for contacts … and again, we are getting the unauthorized user. … So that's normal behavior. … The second thing we're going to do now … is create a new user. … So I'm going to change this it auth … and register like so. … And we need a few things when we register in the Body. … So we need a username … and if you're not sure, … what you can do is go back to the code here … and look into your user model. …
- Open Web Application Security Project (OWASP)
- Reasons for using a JSON Web Token (JWT)
- Adding bcrypt password hashing
- Adding handlers for registration and login
- Finalizing secured endpoints
- Testing APIs with Postman