Start with basic authentication

This commit is contained in:
ricola 2025-04-06 17:04:31 -06:00
commit 5e8cda6fc0
6 changed files with 89 additions and 0 deletions

5
views/home.erb Normal file
View file

@ -0,0 +1,5 @@
<h1>Home</h1>
<p>Hello, <%= current_user.email %>.</p>
<form action="/logout" method="POST">
<input type="submit" value="Log out" />
</form>

10
views/layout.erb Normal file
View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
</head>
<body>
<%= yield %>
</body>
</html>

9
views/login.erb Normal file
View file

@ -0,0 +1,9 @@
<h1>Log in</h1>
<% if @error %>
<p class="error"><%= @error %></p>
<% end %>
<form action="/login" method="POST">
<input name="email" placeholder="Email" />
<input name="password" type="password" placeholder="Password" />
<input type="submit" value="Log in" />
</form>