{% extends "base.html" %} {% load static %} {% block title %}Security Settings - Stream Processor{% endblock %} {% block page_title %}
Security Settings
{% endblock %} {% block extra_head %} {% endblock %} {% block content %}

Security Settings

Manage your account security and authentication preferences

Security Overview

Configure two-factor authentication, manage active sessions, and review login attempts.

{% if messages %} {% for message in messages %}
{{ message }}
{% endfor %} {% endif %}

Two-Factor Authentication

Add an extra layer of security to your account

{% if profile.is_2fa_enabled %} Enabled {% else %} Disabled {% endif %}
{% if profile.is_2fa_enabled %}
Two-factor authentication is active. You have {{ profile.backup_codes|length }} backup codes remaining.
{% else %}
Your account is not protected by two-factor authentication. Enable it now for better security.
Enable Two-Factor Authentication {% endif %}

Security Preferences

Configure your security settings

{% csrf_token %}
{{ security_form.login_notifications }} {% if security_form.login_notifications.help_text %}

{{ security_form.login_notifications.help_text }}

{% endif %}
{{ security_form.session_timeout }} {% if security_form.session_timeout.help_text %}

{{ security_form.session_timeout.help_text }}

{% endif %}

Change Password

Update your account password

{% if profile.last_password_change %}
Last changed: {{ profile.last_password_change|date:"F j, Y g:i A" }}
{% endif %}
{% csrf_token %}
{{ password_form.old_password }} {% if password_form.old_password.errors %}
{% for error in password_form.old_password.errors %} {{ error }} {% endfor %}
{% endif %}
{{ password_form.new_password1 }} {% if password_form.new_password1.errors %}
{% for error in password_form.new_password1.errors %} {{ error }} {% endfor %}
{% endif %}
{{ password_form.new_password2 }} {% if password_form.new_password2.errors %}
{% for error in password_form.new_password2.errors %} {{ error }} {% endfor %}
{% endif %}

Active Sessions

Manage your active login sessions

{% for session in active_sessions %}
{% if session.session_key == current_session_key %} Current Session {% else %} {{ session.user_agent|truncatechars:50 }} {% endif %}
IP: {{ session.ip_address }} Last active: {{ session.last_activity|timesince }} ago {% if session.session_key == current_session_key %} Current {% endif %}
{% if session.session_key != current_session_key %} {% endif %}
{% empty %}

No active sessions found

{% endfor %}

Recent Login Attempts

Monitor login activity on your account

{% for attempt in recent_attempts %}
{% if attempt.success %} Successful login {% else %} Failed login attempt {% endif %}
{{ attempt.ip_address }} {{ attempt.created_at|timesince }} ago {% if attempt.user_agent %} {{ attempt.user_agent|truncatechars:30 }} {% endif %}
{% empty %}

No recent login attempts

{% endfor %}
{% endblock %}