comparison src/change_email.html.luan @ 0:8f4df159f06b

start public repo
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Jul 2025 20:57:49 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f4df159f06b
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local Html = require "luan:Html.luan"
4 local html_encode = Html.encode or error()
5 local Io = require "luan:Io.luan"
6 local Http = require "luan:http/Http.luan"
7 local Shared = require "site:/lib/Shared.luan"
8 local head = Shared.head or error()
9 local page_header = Shared.page_header or error()
10 local footer = Shared.footer or error()
11 local User = require "site:/lib/User.luan"
12 local Logging = require "luan:logging/Logging.luan"
13 local logger = Logging.logger "change_email.html"
14
15
16 return function()
17 local user = User.current_required()
18 if user==nil then return end
19 Io.stdout = Http.response.text_writer()
20 %>
21 <!doctype html>
22 <html lang="en">
23 <head>
24 <% head() %>
25 <title>Link My Style</title>
26 </head>
27 <body>
28 <form page onsubmit="ajaxForm('/change_email.js',this)" action="javascript:">
29 <% page_header() %>
30 <div>
31 <h1>Enter confirmation code</h1>
32 <p>To change your email, enter the six digit code we sent to your inbox (<%=html_encode(user.new_email)%>).</p>
33 <input type=text required name=code placeholder="Enter 6-digit code">
34 <div error=code></div>
35 <button type=submit big>Continue</button>
36 </div>
37 <% footer() %>
38 </form>
39 </body>
40 </html>
41 <%
42 end