From the course: Databases for Node.js Developers

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Implementing the user login

Implementing the user login - Node.js Tutorial

From the course: Databases for Node.js Developers

Implementing the user login

- [Instructor] In this video, we are finalizing our user management by adding a login. As you see, we already have this login form in place, but right now it's doing nothing. When we look at our code, you will find this login in routes, user.js. And here again, we have everything in place already. So all that is missing are the calls to the database. If you wonder where the view for that is, you will find it in login.ejs. So that's the login form. Let's close the site for now and let's start implementing. So the login page is already rendered. We are done with that. And then we have this post login page. So this is the route that actually does the login. And here I added for you a Fastify schema definition. So this is a definition that really makes sure that the data that is sent by the user is valid. It shows the required properties and also some links. For instance, the password has to be a length of 6, and the string that comes in has to be a email. So that's proper input…

Contents