{% extends "tlcc_auth/base_auth.html" %}
{% block title %}Sessions{% endblock %}
{% block content %}
<h1>Active sessions</h1>
<table>
<thead><tr><th>Key</th><th>Expires</th><th>Action</th></tr></thead>
<tbody>
{% for s in sessions %}
<tr>
<td>{{ s.session_key }}</td>
<td>{{ s.expire_date }}</td>
<td>
  <form method="post" action="{% url 'tlcc_auth:revoke-session' %}">
    {% csrf_token %}
    <input type="hidden" name="session_key" value="{{ s.session_key }}">
    <button type="submit">Revoke</button>
  </form>
</td>
</tr>
{% empty %}
<tr><td colspan="3">No active sessions</td></tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
