-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve oauth templates, add authorized token revoke in settings
- Loading branch information
Showing
8 changed files
with
236 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
froide/account/templates/oauth2_provider/application_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% extends "oauth2_provider/base.html" %} | ||
{% load i18n %} | ||
{% block content %} | ||
<div class="block-center"> | ||
<h3 class="block-center-heading">{{ application.name }}</h3> | ||
<ul class="unstyled"> | ||
<li> | ||
<p> | ||
<b>{% trans "Client id" %}</b> | ||
</p> | ||
<input class="input-block-level" | ||
type="text" | ||
value="{{ application.client_id }}" | ||
readonly> | ||
</li> | ||
{% if not application.hash_client_secret %} | ||
<li> | ||
<p> | ||
<b>{% trans "Client secret" %}</b> | ||
</p> | ||
<input class="input-block-level" | ||
type="text" | ||
value="{{ application.client_secret }}" | ||
readonly> | ||
</li> | ||
{% else %} | ||
<li>{% trans "Client secret has been hashed and can no longer be viewed." %}</li> | ||
{% endif %} | ||
<li> | ||
<p> | ||
<b>{% trans "Client type" %}</b> | ||
</p> | ||
<p>{{ application.client_type }}</p> | ||
</li> | ||
<li> | ||
<p> | ||
<b>{% trans "Authorization Grant Type" %}</b> | ||
</p> | ||
<p>{{ application.authorization_grant_type }}</p> | ||
</li> | ||
<li> | ||
<p> | ||
<b>{% trans "Redirect Uris" %}</b> | ||
</p> | ||
<textarea class="input-block-level" readonly>{{ application.redirect_uris }}</textarea> | ||
</li> | ||
<li> | ||
<p> | ||
<b>{% trans "Post Logout Redirect Uris" %}</b> | ||
</p> | ||
<textarea class="input-block-level" readonly>{{ application.post_logout_redirect_uris }}</textarea> | ||
</li> | ||
<li> | ||
<p> | ||
<b>{% trans "Allowed Origins" %}</b> | ||
</p> | ||
<textarea class="input-block-level" readonly>{{ application.allowed_origins }}</textarea> | ||
</li> | ||
</ul> | ||
<div class="btn-toolbar"> | ||
<a class="btn" href="{% url "oauth2_provider:list" %}">{% trans "Go Back" %}</a> | ||
<a class="btn btn-primary" | ||
href="{% url "oauth2_provider:update" application.pk %}">{% trans "Edit" %}</a> | ||
<a class="btn btn-danger" | ||
href="{% url "oauth2_provider:delete" application.pk %}">{% trans "Delete" %}</a> | ||
</div> | ||
</div> | ||
{% endblock content %} |
27 changes: 27 additions & 0 deletions
27
froide/account/templates/oauth2_provider/application_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "oauth2_provider/base.html" %} | ||
{% load i18n %} | ||
{% load form_helper %} | ||
{% block content %} | ||
<div class="block-center"> | ||
<form class="form-horizontal" | ||
method="post" | ||
action="{% block app-form-action-url %}{% url 'oauth2_provider:update' application.id %}{% endblock app-form-action-url %}"> | ||
{% csrf_token %} | ||
<h3 class="block-center-heading"> | ||
{% block app-form-title %} | ||
{% trans "Edit application" %} {{ application.name }} | ||
{% endblock app-form-title %} | ||
</h3> | ||
{% render_form form %} | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<a class="btn" | ||
href="{% block app-form-back-url %}{% url "oauth2_provider:detail" application.id %}{% endblock app-form-back-url %}"> | ||
{% trans "Go Back" %} | ||
</a> | ||
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
froide/account/templates/oauth2_provider/authorized-tokens.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends "oauth2_provider/base.html" %} | ||
{% load i18n %} | ||
{% block content %} | ||
<div class="block-center"> | ||
<h1>{% trans "External applications with access to your account" %}</h1> | ||
<p>{% trans "You have given the following applications access to your account." %}</p> | ||
<ul class="list-unstyled"> | ||
{% for authorized_token in authorized_tokens %} | ||
<li> | ||
<details> | ||
<summary> | ||
{{ authorized_token.application.name }} | ||
{% if authorized_token.is_expired %} | ||
<span class="badge text-bg-secondary">{% trans "Expired" %}</span> | ||
{% endif %} | ||
</summary> | ||
{% if authorized_token.application.description %} | ||
<blockquote> | ||
{{ authorized_token.application.description|linebreaks }} | ||
</blockquote> | ||
{% endif %} | ||
<ul> | ||
{% for scope_name, scope_description in authorized_token.scopes.items %} | ||
<li> | ||
<span title="{{ scope_name }}">{{ scope_description }}</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<dl> | ||
<dt>{% trans "Created" %}</dt> | ||
<dd> | ||
{{ authorized_token.created|date:"DATETIME_FORMAT" }} | ||
</dd> | ||
{% if authorized_token.updated|date:"DATETIME_FORMAT" != authorized_token.created|date:"DATETIME_FORMAT" %} | ||
<dt>{% trans "Updated" %}</dt> | ||
<dd> | ||
{{ authorized_token.updated|date:"DATETIME_FORMAT" }} | ||
</dd> | ||
{% endif %} | ||
<dt>{% trans "Expires" %}</dt> | ||
<dd> | ||
{{ authorized_token.expires|date:"DATETIME_FORMAT" }} | ||
</dd> | ||
</dl> | ||
<form class="mb-3" | ||
action="{% url 'oauth2_provider:authorized-token-delete' authorized_token.pk %}" | ||
method="post"> | ||
{% csrf_token %} | ||
<button type="submit" class="btn btn-danger">{% trans "Revoke access" %}</button> | ||
</form> | ||
</details> | ||
</li> | ||
{% empty %} | ||
<li>{% trans "There are no external applications with." %}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters