Files
plumber/templates/register.html
T
codegirl007 59513ab75e Harden auth: setup secret, throttling, session destroy, secure cookies.
Replace username-based admin bootstrap with a one-time setup secret, rate-limit login/register, equalize login bcrypt timing, cap passwords at 72 bytes, destroy sessions on logout, and require Secure cookies when PORT is set.
2026-08-22 11:47:42 -07:00

24 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "register"}}
{{template "header" .}}
<main id="main" class="wrap auth-wrap">
<p class="eyebrow">New account</p>
<h1>Create an account</h1>
{{if .Error}}<p class="banner error" role="alert">{{.Error}}</p>{{end}}
<form class="ask" method="post" action="/register">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
<label for="username">Username</label>
<input id="username" name="username" type="text" required minlength="3" maxlength="20" pattern="[A-Za-z0-9_]+" autocomplete="username" autocapitalize="off" spellcheck="false" value="{{.Username}}">
<p class="hint">320 letters, numbers, or underscores.</p>
<label for="password">Password</label>
<input id="password" name="password" type="password" required minlength="8" maxlength="72" autocomplete="new-password">
<p class="hint">At least 8 characters (max 72 bytes).</p>
<label for="setup_secret">Setup secret <span class="hint">(optional, first install only)</span></label>
<input id="setup_secret" name="setup_secret" type="password" autocomplete="off">
<p class="hint">Only needed once to create the first admin. Leave blank otherwise.</p>
<button type="submit" class="btn btn-primary">Create account</button>
</form>
<p class="switch">Already have an account? <a href="/login">Sign in</a></p>
</main>
{{template "footer" .}}
{{end}}