{% extends shell('app') %} {% from 'apikeys/macros.html' import token_state %} {% block title %}{{ _('API tokens') }} - {{ _('Admin') }}{% endblock %} {% block content %}

{{ _('API tokens') }}

{{ _('Find an account by its address to see its tokens and revoke them all, for a leaked token or an account taken over.') }}

{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %}
{% for category, message in messages %}
{{ message }}
{% endfor %}
{% endif %} {% endwith %} {% if email and not account %}
{{ _('No account has that address.') }}
{% elif account %}

{{ account.email }}

{% if tokens | rejectattr('is_revoked') | list %}
{{ revoke_all_form.hidden_tag() }}
{% endif %}
{% if tokens %}
{% for token in tokens %} {% endfor %}
{{ _('Name') }} {{ _('Token') }} {{ _('Scopes') }} {{ _('Created') }} {{ _('Expires') }} {{ _('Last used') }} {{ _('State') }}
{{ token.name }} {{ token.prefix }}... {% for scope in token.scope_list %} {{ scope }} {% endfor %} {{ token.created_at.strftime('%Y-%m-%d %H:%M') if token.created_at else '' }} {{ token.expires_at.strftime('%Y-%m-%d %H:%M') if token.expires_at else _('Never') }} {{ token.last_used_at.strftime('%Y-%m-%d %H:%M') if token.last_used_at else _('Never') }} {{ token_state(token) }}
{% else %}
{{ _('This account has no tokens.') }}
{% endif %} {% endif %} {% endblock %}