OXYGENHUB
# ae138eea7a71 oxygenhub / templates / device.html
2.0 KiB · HTML · last changed Device tokens expire and renew on use; the approval page shows the requester (closes #70) 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}Sign in a device{% endblock %}
3
{% block content %}
4
<div class="head"><h1>Sign in a device <small>an app asked to use your account</small></h1></div>
5
{% if let Some(d) = done %}<p class="note">{{ d }}</p>{% endif %}
6
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
7
{% if let Some((d, asked)) = pending %}
8
<form class="card wide" method="post" action="/device">
9
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
10
  <input type="hidden" name="code" value="{{ d.user_code }}">
11
  <h2><strong>{{ d.client }}</strong> wants to sign in as you</h2>
12
  <p class="small">Code <code>{{ d.user_code }}</code>, asked for <time title="{{ d.created_ms|when_i }}">{{ d.created_ms|ago_i }}</time>{% if !d.requester.is_empty() %} from <code>{{ d.requester }}</code>{% endif %}.</p>
13
  <p class="warn small">Approve only a code you started yourself, just now, on your own device. If someone sent you this code or link, deny it: they are asking for access to your account.</p>
14
  <p class="small">The app gets a token with what you allow here. It expires after 90 days without use, and you can revoke it under Settings → Tokens.</p>
15
  <label>Allow it to</label>
16
  <div class="scopes">
17
    {% for (name, what) in asked %}<label><input type="checkbox" name="scopes" value="{{ name }}" checked> <code>{{ name }}</code> <span class="small mute">{{ what }}</span></label>{% endfor %}
18
  </div>
19
  <button type="submit" name="action" value="approve">APPROVE</button>
20
  <button type="submit" name="action" value="deny" class="secondary">DENY</button>
21
</form>
22
{% else %}
23
<form class="card" method="post" action="/device">
24
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
25
  <label for="code">The code your app shows</label>
26
  <input type="text" id="code" name="code" value="{{ code }}" required autofocus autocomplete="off" placeholder="BCDF-GHJK" style="text-transform:uppercase">
27
  <button type="submit" name="action" value="lookup">CONTINUE</button>
28
</form>
29
{% endif %}
30
{% endblock %}