Join Emmanuel Henri to finalize the project by updating the routes required to finalize the registration and login endpoints.
- [Instructor] So we need to add our routes … for registration and log in, … but also make sure we add the functions … that will check for a logged in user before proceeding. … So let's go ahead and work on this. … For this particular code … we're going to need to work in the routes. … So go into the routes folder and then open the crmRoutes. … And the first thing we're going to do is import the functions … that we've created inside of the userController. … So let's go ahead and do import … and then what I'm going to do is do the from first, … from dot dot controller, … or controllers, userController, … like so, and then what I can do is use that … to import the functions in question. … So for example we're going to have access to login. … So if I type L I'm going to see login, and then register, … and then loginRequired, … and these are the functions that we need. … So once we have these functions … we can pass them to the routes. … So what we're going to do is pass the loginRequired …
- 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