{% extends "base.html" %} {% load allauth %} {% load i18n %} {% block head_title %} {% trans "Two-Factor Authentication" %} {% endblock head_title %} {% block content %}

{% trans "Two-Factor Authentication" %}

{% trans "Enhance your account security with multi-factor authentication. Choose from authenticator apps, security keys, and recovery codes." %}

{% if messages %}
{% for message in messages %} {% endfor %}
{% endif %}
{% if "totp" in MFA_SUPPORTED_TYPES %}
{% translate "Authenticator App" %}

{% if authenticators.totp %} {% translate "Authentication using an authenticator app is active." %} {% else %} {% translate "An authenticator app is not active." %} {% endif %}

{% url 'mfa_deactivate_totp' as deactivate_url %} {% url 'mfa_activate_totp' as activate_url %} {% if authenticators.totp %} {% translate "Deactivate" %} {% else %} {% translate "Activate" %} {% endif %}
{% endif %} {% if "webauthn" in MFA_SUPPORTED_TYPES %}
{% translate "Security Keys" %}

{% if authenticators.webauthn|length %} {% blocktranslate count count=authenticators.webauthn|length %}You have added {{ count }} security key.{% plural %}You have added {{ count }} security keys.{% endblocktranslate %} {% else %} {% translate "No security keys have been added." %} {% endif %}

{% if authenticators.webauthn|length %} {% url 'mfa_list_webauthn' as webauthn_list_url %} {% translate "Manage" %} {% else %} {% url 'mfa_add_webauthn' as webauthn_add_url %} {% translate "Add" %} {% endif %}
{% endif %} {% if "recovery_codes" in MFA_SUPPORTED_TYPES %} {% with total_count=authenticators.recovery_codes.generate_codes|length unused_count=authenticators.recovery_codes.get_unused_codes|length %}
{% translate "Recovery Codes" %}

{% if authenticators.recovery_codes %} {% blocktranslate count unused_count=unused_count %}There is {{ unused_count }} out of {{ total_count }} recovery codes available.{% plural %}There are {{ unused_count }} out of {{ total_count }} recovery codes available.{% endblocktranslate %} {% else %} {% translate "No recovery codes set up." %} {% endif %}

{% if is_mfa_enabled %} {% if authenticators.recovery_codes %} {% if unused_count > 0 %} {% url 'mfa_view_recovery_codes' as view_url %} {% translate "View" %} {% url 'mfa_download_recovery_codes' as download_url %} {% translate "Download" %} {% endif %} {% endif %} {% url 'mfa_generate_recovery_codes' as generate_url %} {% translate "Generate" %} {% endif %}
{% endwith %} {% endif %}
{% endblock content %}