Chapter 9: initial express-auth samples
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> <%= title %> </title>
|
||||
</head>
|
||||
<body>
|
||||
<h1> <%= title %> </h1>
|
||||
<p> Welcome to <%= title %> </p>
|
||||
<% if (user) { %>
|
||||
<p> Hello <%= user.name %>! </p>
|
||||
<p> <a href=/auth/logout> Logout </a> </p>
|
||||
<% } else { %>
|
||||
<p> <a href=/auth/login> Login </a> </p>
|
||||
<% } %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Express - Login</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Login</h1>
|
||||
<% if (fail) { %>
|
||||
<h2>Login Failed.</h2>
|
||||
<% } %>
|
||||
<form method="post" action="login">
|
||||
Username: <input name="username" />
|
||||
Password: <input type="password" name="password" />
|
||||
<input type="submit" value="Login" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user