{% extends "dashboard/layout.html" %} {% block title %}{{ _('Security & Sessions – Dashboard') }}{% endblock %} {% block dashboard_content %}

{{ _('Security & Sessions') }}

{{ _('Manage your password, active sessions, and security events') }}

{{ _('Change Password') }}

{{ _('Active Sessions') }}

{{ _('Devices currently logged into your account') }}

{% if sessions|length > 1 %}
{% endif %}
{% if sessions %}
{% for sess in sessions %}
{% if sess.device_type == 'mobile' %} {% elif sess.device_type == 'tablet' %} {% else %} {% endif %}
{{ sess.user_agent[:60] ~ '…' if sess.user_agent|length > 60 else sess.user_agent or _('Unknown device') }} {% if sess.is_current %} {{ _('This device') }} {% endif %}
{% if sess.ip_address %}{{ sess.ip_address }}{% endif %} {% if sess.last_seen_at %}{{ _('Last seen') }}: {{ sess.last_seen_at[:16] }}{% endif %} {{ sess.device_type }}
{% if not sess.is_current %}
{% endif %}
{% endfor %}
{% else %}

{{ _('No active sessions recorded yet.') }}

{% endif %}

{{ _('Recent Security Events') }}

{% if events %}
{% for ev in events %}
{% if ev.event_type == 'password_changed' %} {% elif ev.event_type == 'login' %} {% elif 'fail' in ev.event_type %} {% else %} {% endif %}
{{ ev.description or ev.event_type }}
{{ ev.created_at[:16] if ev.created_at else '' }} {% if ev.ip_address %}· {{ ev.ip_address }}{% endif %}
{% endfor %}
{% else %}

{{ _('No security events recorded yet.') }}

{% endif %}
{% endblock %}