misaki/tmpl/reset.html
q 119b6d73c4
Some checks failed
Build & push Docker image / build (push) Has been cancelled
totp 2fac
2026-11-07 11:43:40 -05:00

37 lines
1.8 KiB
HTML

{{template "base.html" .}}
{{define "title"}}Reset Password{{end}}
{{define "content"}}
<h1>Reset password</h1>
{{if eq .Mode "request"}}
{{if .CanReset}}
<p>Enter your username. If your account has a contact email, misaki sends it a link that works once, for 30 minutes.</p>
<form method="POST" action="/reset">
<label for="username">Username</label>
<input type="text" id="username" name="username" required autocomplete="username" maxlength="64">
<input type="submit" value="Send link">
</form>
{{end}}
<p style="margin-top:1.5rem;font-size:.9rem">No email on your account? Ask an admin for a reset link. They never see or set your password.</p>
{{else if eq .Mode "sent"}}
<p class="ok">If that account has a contact email, a link is on its way. Check your spam folder too.</p>
{{else if eq .Mode "set"}}
{{if .Error}}<p class="err">{{.Error}}</p>{{end}}
<form method="POST" action="/reset/confirm">
<input type="hidden" name="t" value="{{.Token}}">
<label for="password">New password</label>
<input type="password" id="password" name="password" required minlength="8" maxlength="128" autocomplete="new-password">
<label for="password_confirm">Again</label>
<input type="password" id="password_confirm" name="password_confirm" required minlength="8" maxlength="128" autocomplete="new-password">
{{if .NeedCode}}
<label for="code">2FA code (or a recovery code)</label>
<input type="text" id="code" name="code" required autocomplete="one-time-code" maxlength="24">
{{end}}
<input type="submit" value="Set password">
</form>
<p style="margin-top:1rem;font-size:.9rem">This logs you out everywhere.</p>
{{else}}
<p class="err">This link has expired or was already used.</p>
<p><a href="/reset">Get a new one</a></p>
{{end}}
<p style="margin-top:1rem;font-size:.9rem"><a href="/login">Back to login</a></p>
{{end}}