{% extends 'layout.html' %} {% from 'include/panel.html' import panel %} {% from 'include/modal_dialog.html' import modal_dialog, button_confirm, modal_confirm %} {% set breadcrumbs = breadcrumb_page('prefs') + breadcrumb_page(self) %} {% block content %}
{# Header #}

{% trans %}Access Tokens{% endtrans %}

{# Help text #}

{% trans %}You can use access tokens to authenticate to this application. They are the only accepted password when you have Two-Factor Authentication (2FA) enabled.{% endtrans %}

{# Token count summary #}

{{ _('%(count)s access tokens associated with your account.', count=tokens|length) }}

{# Token list #}
{% for token in tokens %}
{{ token.name }}
{% trans %}Created{% endtrans %} {% trans %}Last used{% endtrans %} {% if token.access_time %} {% else %} {% trans %}Never{% endtrans %} {% endif %} {% trans %}Expires{% endtrans %} {% if token.expiration_time %} {% else %} {% trans %}Never{% endtrans %} {% endif %}
{% set scope_table = dict(form.scope.choices) %} {%- for s in token.scope -%} {% set scope_label = scope_table.get(s, s).split(' - ')[0] %} {% set scope_help = scope_table.get(s, s).split(' - ')[1] %} {{ scope_label }} {%- else -%} {% trans %}Default access{% endtrans %} {%- endfor -%}
{% else %}

{% endfor %}
{# Add Access Token #}
{% if form.error_message %}

{{ form.error_message }}

{% endif %}
{# Delete Modal #}

{% trans %}Any application using this token will immediately lose access.{% endtrans %}

{% endblock %}