Mercurial Hosting > linkmystyle
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/change_email.html.luan Fri Jul 11 20:57:49 2025 -0600 @@ -0,0 +1,42 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Html = require "luan:Html.luan" +local html_encode = Html.encode or error() +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Shared = require "site:/lib/Shared.luan" +local head = Shared.head or error() +local page_header = Shared.page_header or error() +local footer = Shared.footer or error() +local User = require "site:/lib/User.luan" +local Logging = require "luan:logging/Logging.luan" +local logger = Logging.logger "change_email.html" + + +return function() + local user = User.current_required() + if user==nil then return end + Io.stdout = Http.response.text_writer() +%> +<!doctype html> +<html lang="en"> + <head> +<% head() %> + <title>Link My Style</title> + </head> + <body> + <form page onsubmit="ajaxForm('/change_email.js',this)" action="javascript:"> +<% page_header() %> + <div> + <h1>Enter confirmation code</h1> + <p>To change your email, enter the six digit code we sent to your inbox (<%=html_encode(user.new_email)%>).</p> + <input type=text required name=code placeholder="Enter 6-digit code"> + <div error=code></div> + <button type=submit big>Continue</button> + </div> +<% footer() %> + </form> + </body> +</html> +<% +end