From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Configuring login page - Nest.js Tutorial
From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Configuring login page
Now we are going to create and configure the login page. So first, let's create a login template. I'll create a file inside the views folder and name it as login EJS. Now the login page will be more or less similar to the sign up page. So I'll copy the structure of the sign up template and paste it here in the login. I'll make some updates like changing the title, updating the action route, and changing the heading. We won't need the confirm password field, so let's just remove it. I'll update the button text to login, and the icon to bi bi person. I'll remove the confirm password cases from the switch statement, and we'll also remove validate password function as there is no confirm password field. We will check the login credentials from the database which will be at a later stage. All right, this is it for now. We will refine the code if needed at a later stage of course. But for now, let's go with this. Let's define the get route handler inside the user controller to render the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Section introduction2m 33s
-
(Locked)
Setting up the sign-up route2m 24s
-
(Locked)
Designing the sign-up form2m 53s
-
(Locked)
Implementing show/hide password functionality4m 40s
-
(Locked)
Validating password2m 32s
-
(Locked)
Registering user to the database6m 50s
-
(Locked)
Configuring login page2m 12s
-
(Locked)
Validating user and sending cookie4m 41s
-
(Locked)
Reading a cookie2m 13s
-
(Locked)
Rendering DOM based on login status3m 48s
-
(Locked)
Implementing logout1m 20s
-
(Locked)
Configuring Express-Session2m 54s
-
(Locked)
Sending and reading session cookie3m 40s
-
(Locked)
Storing sessions in MySQL3m 44s
-
(Locked)
Destroying the session: Logout1m 42s
-
(Locked)
Optimizing session storage4m 15s
-
(Locked)
Implementing JWT token6m 51s
-
(Locked)
Validating request with middleware5m
-
(Locked)
Conditional rendering with token6m 14s
-
(Locked)
Hashing the password on sign-up3m 51s
-
(Locked)
Validating login credentials2m 15s
-
(Locked)
Finalizing MyStore application4m 20s
-
(Locked)
-
-