view src/account.html.luan @ 5:a49866b52cc2

login to chat
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 29 Oct 2024 13:10:47 -0600
parents 2da10ece826f
children e22a1ba4b2ed
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.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 header = Shared.header or error()
local Utils = require "site:/lib/Utils.luan"
local base_url = Utils.base_url or error()
local User = require "site:/lib/User.luan"
local current_user = User.current_required or error()


return function()
	local user = current_user()
	if user == nil then return end
	Io.stdout = Http.response.text_writer()
%>
<!doctype html>
<html>
	<head>
<%		head() %>
	</head>
	<body>
<%		header() %>
		<div content>
			<h1>Your Account</h1>
			<p><a href="chat.html">Your Chats</a></p>
			<p>Your URL: <%= base_url() %>/chat.html?with=<%=user.email%></p>
			<p><a href="javascript:logout()">Logout</a></p>
		</div>
	</body>
</html>
<%
end