| 1 |
{% extends "base.html" %} |
| 2 |
{% block title %}{% if mode == "verified" || mode == "verify-invalid" %}Email address{% else %}Reset your password{% endif %}{% endblock %} |
| 3 |
{% block content %} |
| 4 |
{% if mode == "verified" %} |
| 5 |
<div class="head"><h1>Email verified</h1></div> |
| 6 |
<p class="note"><strong>{{ username }}</strong> is confirmed. Notification email can go there now.</p> |
| 7 |
<p><a href="/settings">Settings</a></p> |
| 8 |
{% else if mode == "verify-invalid" %} |
| 9 |
<div class="head"><h1>Email address</h1></div> |
| 10 |
<p class="error">This verification link has expired, was already used, or is for an address the account no longer has.</p> |
| 11 |
<p>Send a new one from <a href="/settings">Settings</a>.</p> |
| 12 |
{% else if mode == "request" %} |
| 13 |
<div class="head"><h1>Reset your password</h1></div> |
| 14 |
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %} |
| 15 |
{% if mail %} |
| 16 |
<form class="card" method="post" action="/login/reset"> |
| 17 |
<label for="who">Username or verified email</label><input type="text" id="who" name="who" autocomplete="username" autofocus required> |
| 18 |
<button type="submit">SEND A RESET LINK</button> |
| 19 |
</form> |
| 20 |
<p class="small mute">The link goes to the account's verified email and works once, for one hour.</p> |
| 21 |
{% else %} |
| 22 |
<p>This hub does not send email. Ask an administrator for a reset link: they can issue one from the admin page, valid for 24 hours.</p> |
| 23 |
{% endif %} |
| 24 |
<p class="small mute"><a href="/login">Back to sign in</a></p> |
| 25 |
{% else if mode == "sent" %} |
| 26 |
<div class="head"><h1>Check your email</h1></div> |
| 27 |
<p>If that matches an account with a verified email, a reset link is on its way. It works once, for one hour.</p> |
| 28 |
<p class="small mute">Nothing arriving? The account may have no verified email; an administrator can issue a reset link instead.</p> |
| 29 |
{% else if mode == "new" %} |
| 30 |
<div class="head"><h1>Choose a new password <small>{{ username }}</small></h1></div> |
| 31 |
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %} |
| 32 |
<form class="card" method="post" action="/login/reset/{{ secret }}"> |
| 33 |
<input type="text" name="username" value="{{ username }}" autocomplete="username" hidden> |
| 34 |
<label for="password">New password</label><input type="password" id="password" name="password" autocomplete="new-password" required autofocus> |
| 35 |
<label for="confirm">The same again</label><input type="password" id="confirm" name="confirm" autocomplete="new-password" required> |
| 36 |
<button type="submit">SET PASSWORD</button> |
| 37 |
</form> |
| 38 |
<p class="small mute">Every session of this account is signed out. Two-factor sign-in stays on if you use it.</p> |
| 39 |
{% else %} |
| 40 |
<div class="head"><h1>Reset your password</h1></div> |
| 41 |
<p class="error">This reset link has expired or was already used.</p> |
| 42 |
<p><a href="/login/reset">Ask for a new one</a></p> |
| 43 |
{% endif %} |
| 44 |
{% endblock %} |