mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-30 00:19:08 -04:00
auth: learning express auth
This commit is contained in:
parent
0647b4af89
commit
518abdc55e
6 changed files with 363 additions and 0 deletions
29
auth-expressjs/src/views/index.ejs
Normal file
29
auth-expressjs/src/views/index.ejs
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<% if (locals.user) {%>
|
||||
MY PERSON <%= user.username %>
|
||||
<a href="/log-out">LOG OUT</a>
|
||||
<p> Views: <%= sessions %></p>
|
||||
|
||||
<% } else { %>
|
||||
<p> you should log in man </P
|
||||
<h1>please log in</h1>
|
||||
|
||||
<form action="/log-in" method="POST">
|
||||
<label for="username">Username</label>
|
||||
<input id="username" name="username" placeholder="username" type="text" />
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" />
|
||||
<button>Log In</button>
|
||||
</form>
|
||||
<% } %>
|
||||
|
||||
<a type="button" href="/login/federated/google">Sign in with Google</a>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue