Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed User Authentication With Express and Mongo!
You have completed User Authentication With Express and Mongo!
Preview
In this video add routes to for the application's log in functionality, including a GET route to display the form and a POST route to handle form submissions.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
We'll need two routes
on the same /login URI.
0:00
One route to display the login form,
0:02
the other to process the login
credentials posted from the form.
0:04
I'll add those routes to the index.js
file inside the routes directory.
0:08
The first route to load
the login form is simple.
0:14
It's similar to the route we added for
the registration form.
0:17
We set up a GET request
along the /login route.
0:20
Then we add a callback function.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up