~sircmpwn/meta.sr.ht

ref: 72548bd7545f78670878667674cc7645835a17bd meta.sr.ht/metasrht/templates/oauth2-authorization.html -rw-r--r-- 2.9 KiB
72548bd7Drew DeVault API: Updates per core-go auth changes 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{% extends "layout.html" %}
{% block title %}
<title>Authorize account access - {{cfg("sr.ht", "site-name")}} meta</title>
{% endblock %}
{% block content %}
<div class="row">
  <div class="col-md-12">
    <h3>Authorize account access</h3>
  </div>
</div>
<form class="row" method="POST">
  {{csrf_token()}}
  <section class="col-md-8 offset-md-2 oauth2-authorize">
    <p>
      <strong><a
        href="{{client.url}}"
        target="_blank"
        rel="noopener nofollow"
      >{{client.name}} {{icon('external-link-alt')}}</a></strong>
      would like to access to your {{cfg("sr.ht", "site-name")}} account.
      <strong>{{client.name}}</strong> is a third-party application
      operated by <strong>{{client.owner.canonicalName}}</strong>.
    </p>
    <h4>Review access request</h4>
    <p>{{client.name}} is requesting the following permissions:</p>
    {% macro render_access(grant) %}
      {% if grant[2] == 'RO' %}
      <input
        type="checkbox"
        class="{{valid.cls(grant[0] + "/" + grant[1] + ":RO")}}"
        name="{{grant[0]}}/{{grant[1]}}:RO"
        id="{{grant[0]}}/{{grant[1]}}:RO"
        checked />
      <label for="{{grant[0]}}/{{grant[1]}}:RO">read</label>
      {% elif grant[2] == 'RW' %}
      <input
        type="checkbox"
        class="{{valid.cls(grant[0] + "/" + grant[1] + ":RO")}}"
        name="{{grant[0]}}/{{grant[1]}}:RO"
        id="{{grant[0]}}/{{grant[1]}}:RO"
        {% if valid.cls(grant[0] + "/" + grant[1] + ":RO") != "is-invalid" %}
        checked
        {% endif %} />
      <label for="{{grant[0]}}/{{grant[1]}}:RO">read</label>
      and
      <input
        type="checkbox"
        class="{{valid.cls(grant[0] + "/" + grant[1] + ":RW")}}"
        name="{{grant[0]}}/{{grant[1]}}:RW"
        id="{{grant[0]}}/{{grant[1]}}:RW"
        checked />
      <label for="{{grant[0]}}/{{grant[1]}}:RW">write</label>
      {% endif %}
    {% endmacro %}
    <div class="event-list grant-list">
      <ul class="event">
        {% for grant in grants %}
        <li>
          {{render_access(grant)}} access to your
          <strong>{{grant[0]}} {{grant[1]}}</strong>
          {{valid.summary(grant[0] + "/" + grant[1] + ":RO")}}
        </li>
        {% endfor %}
      </ul>
    </div>
    <div class="alert alert-info">
      You may uncheck any permission to deny access, but doing so may prevent
      this third-party application from working correctly.
    </div>
    <input type="hidden" name="client_id" value="{{ client_id }}" />
    <input type="hidden" name="redirect_uri" value="{{ redirect_uri }}" />
    {% if state %}
    <input type="hidden" name="state" value="{{ state }}" />
    {% endif %}
    {{valid.summary()}}
    <button
      type="submit"
      name="accept"
      class="btn btn-danger"
    >Grant account access {{icon('caret-right')}}</button>
    <button
      type="submit"
      name="reject"
      class="btn btn-default"
    >Cancel {{icon('caret-right')}}</button>
  </section>
</form>
{% endblock %}