comparison src/manual_login.html.luan @ 44:1aa50739475a

add manual login
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 27 Feb 2025 22:50:46 -0700
parents src/login.html.luan@7ea33179592a
children 8c3b56bb0c83
comparison
equal deleted inserted replaced
43:89d3ddd302c7 44:1aa50739475a
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local ipairs = Luan.ipairs or error()
4 local Html = require "luan:Html.luan"
5 local html_encode = Html.encode or error()
6 local Io = require "luan:Io.luan"
7 local Http = require "luan:http/Http.luan"
8 local Shared = require "site:/lib/Shared.luan"
9 local head = Shared.head or error()
10 local header = Shared.header or error()
11 local Utils = require "site:/lib/Utils.luan"
12 local to_list = Utils.to_list or error()
13
14
15 return function()
16 Io.stdout = Http.response.text_writer()
17 %>
18 <!doctype html>
19 <html>
20 <head>
21 <% head() %>
22 <style>
23 input[name=email] {
24 width: 300px;
25 max-width: 100%;
26 }
27 [failed] {
28 color: red;
29 }
30 </style>
31 </head>
32 <body>
33 <% header() %>
34 <div content>
35 <h1>Password Login</h1>
36 <form page onsubmit="ajaxForm('/manual_login.js',this)" action="javascript:">
37 <p>
38 <label prompt>Your email address</label>
39 <input type=email name=email required autofocus>
40 </p>
41 <p>
42 <label prompt>Password</label>
43 <input name=password required>
44 </p>
45 <p>
46 <input type=submit>
47 </p>
48 <p failed></p>
49 </form>
50 </div>
51 </body>
52 </html>
53 <%
54 end