OXYGENHUB
# a22e4aec2e28 oxygenhub / templates / sudo.html
2.3 KiB · HTML · last changed A phone as the second factor: Keystore keys approve sign-ins by the number the browser shows, and the sudo step asks a stale session again before sensitive changes (closes #356) 3 days ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}Confirm it is you{% endblock %}
3
{% block content %}
4
<div class="head"><h1>Confirm it is you</h1></div>
5
<p class="mute">This change needs a fresh proof that it is you. It lasts 15 minutes; then go back and make the change again.</p>
6
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
7
{% if let Some((id, number)) = approval %}
8
<section class="card-box">
9
  <div class="approve-wait pad" data-approval-poll="/sudo/approval/{{ id }}" data-approval-next="{{ next }}" aria-live="polite">
10
    <p>Open OxygenHub on your phone and pick</p>
11
    <p class="approve-number" aria-label="the number {{ number }}">{{ number }}</p>
12
    <p class="small mute" data-approval-status>Waiting for your phone…</p>
13
  </div>
14
</section>
15
{% else %}
16
{% if phones %}<section class="card-box">
17
  <form class="pad sec-form sec-split" method="post" action="/sudo/phone">
18
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
19
    <input type="hidden" name="next" value="{{ next }}">
20
    <p>Approve on your phone, with your fingerprint, face or PIN.</p>
21
    <button type="submit">APPROVE ON MY PHONE</button>
22
  </form>
23
</section>{% endif %}
24
{% endif %}
25
<section class="card-box">
26
  <form class="pad sec-form" method="post" action="/sudo">
27
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
28
    <input type="hidden" name="next" value="{{ next }}">
29
    {% if totp %}
30
    <div class="sec-row"><label for="code">{% if phones %}Or a code{% else %}A code{% endif %} from your authenticator app, or a recovery code</label><input type="text" id="code" name="code" inputmode="numeric" autocomplete="one-time-code"{% if !phones %} autofocus{% endif %} required><button type="submit">CONFIRM</button></div>
31
    {% else if password %}
32
    <div class="sec-row"><label for="password">Your password</label><input type="password" id="password" name="password" autocomplete="current-password" autofocus required><button type="submit">CONFIRM</button></div>
33
    <p class="small mute">With two-factor authentication on (Settings › Security), a code or your phone confirms instead.</p>
34
    {% else %}
35
    <p>Your account signs in through another service and has no password here: sign out and sign in again to confirm.</p>
36
    {% endif %}
37
  </form>
38
</section>
39
<p class="small"><a href="{{ next }}">Go back</a></p>
40
{% endblock %}