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 - 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
-
-
-
-
-
-
(Locked)
Using MySQL for our users and orders1m 8s
-
(Locked)
Setting up MySQL with Docker2m 49s
-
(Locked)
Exploring MySQL with MySQL Workbench1m 57s
-
(Locked)
Introducing Sequelize1m 51s
-
(Locked)
Setting up the database connection7m 43s
-
(Locked)
Designing the database structure2m 1s
-
(Locked)
Creating a user model for Sequelize7m 47s
-
(Locked)
Creating the order models for Sequelize11m 56s
-
(Locked)
Loading and syncing the models13m 5s
-
(Locked)
Creating, updating and deleting users with Sequelize12m 52s
-
(Locked)
Securing credentials with password hashing7m 2s
-
(Locked)
Implementing the user login9m 15s
-
(Locked)
-
-
-