kopia lustrzana https://github.com/jointakahe/takahe
Make oauth screens plain as well
rodzic
d88db5efbf
commit
6be1e7df44
|
@ -56,3 +56,18 @@ class NotFound(TemplateView):
|
||||||
class ServerError(TemplateView):
|
class ServerError(TemplateView):
|
||||||
|
|
||||||
template_name = "500.html"
|
template_name = "500.html"
|
||||||
|
|
||||||
|
|
||||||
|
@method_decorator(admin_required, name="dispatch")
|
||||||
|
class OauthAuthorize(TemplateView):
|
||||||
|
|
||||||
|
template_name = "api/oauth_authorize.html"
|
||||||
|
|
||||||
|
def get_context_data(self):
|
||||||
|
return {
|
||||||
|
"application": {"name": "Fake Application", "client_id": "fake"},
|
||||||
|
"redirect_uri": "",
|
||||||
|
"scope": "read write push",
|
||||||
|
"identities": self.request.user.identities.all(),
|
||||||
|
"code": "12345abcde",
|
||||||
|
}
|
||||||
|
|
|
@ -426,6 +426,11 @@ img.emoji {
|
||||||
margin: 4px 0 10px 0;
|
margin: 4px 0 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.authorization-code {
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: 140%;
|
||||||
|
}
|
||||||
|
|
||||||
/* Icon menus */
|
/* Icon menus */
|
||||||
|
|
||||||
.icon-menu .option {
|
.icon-menu .option {
|
||||||
|
|
|
@ -211,9 +211,10 @@ urlpatterns = [
|
||||||
name="rules",
|
name="rules",
|
||||||
),
|
),
|
||||||
# Debug aids
|
# Debug aids
|
||||||
path("debug/json/", debug.JsonViewer.as_view(), name="debug_json"),
|
path("debug/json/", debug.JsonViewer.as_view()),
|
||||||
path("debug/404/", debug.NotFound.as_view(), name="not_found"),
|
path("debug/404/", debug.NotFound.as_view()),
|
||||||
path("debug/500/", debug.ServerError.as_view(), name="server_error"),
|
path("debug/500/", debug.ServerError.as_view()),
|
||||||
|
path("debug/oauth_authorize/", debug.OauthAuthorize.as_view()),
|
||||||
# Media/image proxy
|
# Media/image proxy
|
||||||
path(
|
path(
|
||||||
"proxy/identity_icon/<identity_id>/",
|
"proxy/identity_icon/<identity_id>/",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base_plain.html" %}
|
||||||
|
|
||||||
{% block title %}Authorize {{ application.name }}{% endblock %}
|
{% block title %}Authorize {{ application.name }}{% endblock %}
|
||||||
|
|
||||||
|
@ -24,8 +24,13 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>Do you want to give {{ application.name }} access to this identity?</p>
|
<p>Do you want to give <b>{{ application.name }}</b> access to this identity?</p>
|
||||||
<p>It will have permission to: {{ scope }}</p>
|
<p>It will have permission to:</p>
|
||||||
|
<ul>
|
||||||
|
{% if "read" in scope %}<li>Read all of your data</li>{% endif %}
|
||||||
|
{% if "write" in scope %}<li>Create posts, edit follows, and change all other data</li>{% endif %}
|
||||||
|
{% if "push" in scope %}<li>Receive push notifications</li>{% endif %}
|
||||||
|
</ul>
|
||||||
<input type="hidden" name="client_id" value="{{ application.client_id }}">
|
<input type="hidden" name="client_id" value="{{ application.client_id }}">
|
||||||
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
||||||
<input type="hidden" name="scope" value="{{ scope }}">
|
<input type="hidden" name="scope" value="{{ scope }}">
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base_plain.html" %}
|
||||||
|
|
||||||
{% block title %}Authorization Code{% endblock %}
|
{% block title %}Authorization Code{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>To continue, provide this code to your application: <tt>{{ code }}</tt></p>
|
<h1>Authorization Code</h1>
|
||||||
|
<section>
|
||||||
|
<p>To continue, provide this code to your application:</p>
|
||||||
|
<p class="authorization-code">{{ code }}</p>
|
||||||
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Ładowanie…
Reference in New Issue