summaryrefslogtreecommitdiffstats
path: root/templates/api
diff options
context:
space:
mode:
authorAndrew Godwin2022-12-10 21:03:14 -0700
committerAndrew Godwin2022-12-12 11:56:49 -0700
commit1017c71ba1d80a1690e357a938ad46f246a456ae (patch)
treeffe6172f5f38bb1c8aac3c42ada272bba40348e7 /templates/api
parenta8d1450763bea6f8d5388633b62a92c7d89913b6 (diff)
downloadtakahe-1017c71ba1d80a1690e357a938ad46f246a456ae.tar.gz
takahe-1017c71ba1d80a1690e357a938ad46f246a456ae.tar.bz2
takahe-1017c71ba1d80a1690e357a938ad46f246a456ae.zip
Working start of an OAuth flow
Diffstat (limited to 'templates/api')
-rw-r--r--templates/api/oauth_authorize.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/templates/api/oauth_authorize.html b/templates/api/oauth_authorize.html
new file mode 100644
index 0000000..41aac0d
--- /dev/null
+++ b/templates/api/oauth_authorize.html
@@ -0,0 +1,39 @@
+{% extends "base.html" %}
+
+{% block title %}Authorize {{ application.name }}{% endblock %}
+
+{% block content %}
+ {% if not identities %}
+ <p>
+ You cannot give access to {{ application.name }} as you
+ have no identities yet. Log in via the website and create
+ at least one identity, then retry this process.
+ </p>
+ {% else %}
+ <form method="POST">
+ {% csrf_token %}
+ <fieldset>
+ <legend>Authorize</legend>
+ <div class="field">
+ <div class="label-input">
+ <label for="identity">Select Identity</label>
+ <select name="identity" id="identity">
+ {% for identity in identities %}
+ <option value="{{ identity.pk }}">{{ identity.handle }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ </div>
+ <p>Do you want to give {{ application.name }} access to this identity?</p>
+ <p>It will have permission to: {{ scope }}</p>
+ <input type="hidden" name="client_id" value="{{ application.client_id }}">
+ <input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
+ <input type="hidden" name="scope" value="{{ scope }}">
+ </fieldset>
+ <div class="buttons">
+ <a href="#" class="secondary button left">Deny</a>
+ <button>Allow</button>
+ </div>
+ </form>
+ {% endif %}
+{% endblock %}