OXYGENHUB
# 72cde3da4176 oxygenhub / templates / reset.html
2.6 KiB · HTML · last changed Password reset and email verification: single-use hashed links, reset by verified email or an administrator's link, verification on every address change, notification mail only to verified addresses, and a file:// mail transport for development 1 month ago source blame history raw
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 mail %}
15
<form class="card" method="post" action="/login/reset">
16
  <label for="who">Username or verified email</label><input type="text" id="who" name="who" autocomplete="username" autofocus required>
17
  <button type="submit">SEND A RESET LINK</button>
18
</form>
19
<p class="small mute">The link goes to the account's verified email and works once, for one hour.</p>
20
{% else %}
21
<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>
22
{% endif %}
23
<p class="small mute"><a href="/login">Back to sign in</a></p>
24
{% else if mode == "sent" %}
25
<div class="head"><h1>Check your email</h1></div>
26
<p>If that matches an account with a verified email, a reset link is on its way. It works once, for one hour.</p>
27
<p class="small mute">Nothing arriving? The account may have no verified email; an administrator can issue a reset link instead.</p>
28
{% else if mode == "new" %}
29
<div class="head"><h1>Choose a new password <small>{{ username }}</small></h1></div>
30
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
31
<form class="card" method="post" action="/login/reset/{{ secret }}">
32
  <input type="text" name="username" value="{{ username }}" autocomplete="username" hidden>
33
  <label for="password">New password</label><input type="password" id="password" name="password" autocomplete="new-password" required autofocus>
34
  <label for="confirm">The same again</label><input type="password" id="confirm" name="confirm" autocomplete="new-password" required>
35
  <button type="submit">SET PASSWORD</button>
36
</form>
37
<p class="small mute">Every session of this account is signed out. Two-factor sign-in stays on if you use it.</p>
38
{% else %}
39
<div class="head"><h1>Reset your password</h1></div>
40
<p class="error">This reset link has expired or was already used.</p>
41
<p><a href="/login/reset">Ask for a new one</a></p>
42
{% endif %}
43
{% endblock %}