Generated Accounts context, User schema, and controllers via phx.gen.auth. Adapted it for password-only login with required email confirmation: - Users have callsign (unique, uppercased), name, email, password - Registration form fields: callsign, name, email, password, confirm - Magic-link login path removed; login is email + password only - After register, a confirmation email is sent and login is blocked until the account is confirmed via the token URL - Confirmation link logs the user in on first use - SMTP2GO configured as the outgoing mailer in k8s prod
62 lines
2.4 KiB
Text
62 lines
2.4 KiB
Text
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="csrf-token" content={get_csrf_token()} />
|
|
<.live_title default="North Texas Microwave Society" suffix=" · NTMS">
|
|
{assigns[:page_title]}
|
|
</.live_title>
|
|
<link rel="preconnect" href="https://a.tile.openstreetmap.org" crossorigin />
|
|
<link rel="preconnect" href="https://b.tile.openstreetmap.org" crossorigin />
|
|
<link rel="preconnect" href="https://c.tile.openstreetmap.org" crossorigin />
|
|
<link rel="dns-prefetch" href="https://a.tile.openstreetmap.org" />
|
|
<link rel="dns-prefetch" href="https://b.tile.openstreetmap.org" />
|
|
<link rel="dns-prefetch" href="https://c.tile.openstreetmap.org" />
|
|
<link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
|
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/js/app.js"}>
|
|
</script>
|
|
<script>
|
|
(() => {
|
|
const setTheme = (theme) => {
|
|
if (theme === "system") {
|
|
localStorage.removeItem("phx:theme");
|
|
document.documentElement.removeAttribute("data-theme");
|
|
} else {
|
|
localStorage.setItem("phx:theme", theme);
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
}
|
|
};
|
|
if (!document.documentElement.hasAttribute("data-theme")) {
|
|
setTheme(localStorage.getItem("phx:theme") || "system");
|
|
}
|
|
window.addEventListener("storage", (e) => e.key === "phx:theme" && setTheme(e.newValue || "system"));
|
|
|
|
window.addEventListener("phx:set-theme", (e) => setTheme(e.target.dataset.phxTheme));
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<ul class="menu menu-horizontal w-full relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
|
<%= if @current_scope do %>
|
|
<li>
|
|
{@current_scope.user.email}
|
|
</li>
|
|
<li>
|
|
<.link href={~p"/users/settings"}>Settings</.link>
|
|
</li>
|
|
<li>
|
|
<.link href={~p"/users/log-out"} method="delete">Log out</.link>
|
|
</li>
|
|
<% else %>
|
|
<li>
|
|
<.link href={~p"/users/register"}>Register</.link>
|
|
</li>
|
|
<li>
|
|
<.link href={~p"/users/log-in"}>Log in</.link>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
{@inner_content}
|
|
</body>
|
|
</html>
|