Files
supermarket/internal/web/templates/signin.html
T
davidandClaude Opus 5.5 8040512a18 Phase 10, part 3: signing in and out, resets, locks and two-factor
The server edition now starts. Sign-in by email and password, limited per
address and per IP; ten failures in a row lock the account and email its
owner, and a reset by email (or an admin) unlocks it. Settings → Your
account has the profile, the password, where you're signed in, and
two-factor sign-in with an authenticator app (TOTP, from a QR code) and
ten recovery codes. The app's own mail goes through SUPERMARKET_MAIL_URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:01:29 -07:00

26 lines
1.4 KiB
HTML

{{define "content"}}{{with .Data}}
{{if .Code}}
<h1>Two-factor sign-in</h1>
<p class="lede">Enter the six-digit code your authenticator app shows for Supermarket.</p>
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
<form class="card" method="post" action="/signin/code">
<input type="hidden" name="token" value="{{.Token}}">
<input type="hidden" name="next" value="{{.Next}}">
<label>Code <input name="code" inputmode="numeric" autocomplete="one-time-code" pattern="[0-9 ]{6,7}|[A-Za-z0-9 -]{12,16}" required autofocus>
<span class="help">Lost your phone? Enter one of your recovery codes instead.</span></label>
<button type="submit">Sign in</button>
</form>
<p class="help"><a href="/signin">Start again</a></p>
{{else}}
<h1>Sign in</h1>
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
<form class="card" method="post" action="/signin">
<input type="hidden" name="next" value="{{.Next}}">
<label>Email address <input type="email" name="email" value="{{.Email}}" autocomplete="username" required {{if not .Email}}autofocus{{end}}></label>
<label>Password <input type="password" name="password" autocomplete="current-password" required {{if .Email}}autofocus{{end}}></label>
<button type="submit">Sign in</button>
</form>
<p class="help"><a href="/forgot{{with .Email}}?email={{.}}{{end}}">Forgotten your password?</a></p>
{{end}}
{{end}}{{end}}