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
Build a login form using the Pug (Jade) templating language.
Pug Code for Login Form
login.pug
extends layout
block content
.main.container
.row
.col-md-6.col-md-offset-3
h1.display-4.m-b-2 Log In
form(method='POST' action='/login')
div.form-group
label(for='email') Email
input.form-control(type='text' id='email' placeholder='email' name='email')
div.form-group
label(for='password') Password
input.form-control(type='password' id='password' placeholder='password' name='password')
button.btn.btn-primary(type='submit') Log in
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
that they can log into their account.
0:00
Remember that all the template files
are inside the views directory here.
0:00
I'll create a new file.
0:06
And name it login.pug.
0:08
I'll start with the boilerplate code.
0:13
The code matches the layout we're
using in the registration form.
0:16
It extends the base layout.pug
template for the overall page design.
0:19
Then inserts a block of
content several divs with some
0:24
classes along with an H1
header that says login.
0:28
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