{% extends "flask_deck/base.html" %} {% block breadcrumbs %} / {{ _("2FA Security") }} {% endblock %} {% block content %}

Two-Factor Authentication (TOTP)

Zero-dependency RFC 6238 authenticator protection with replay defense & single-use recovery codes.

{% if enrollment and enrollment.enabled %} MFA ACTIVE {% else %} NOT ENROLLED {% endif %}
{% if error_msg %} {% endif %} {% if recovery_once %}

Save Your One-Time Recovery Codes

Stored as PBKDF2 hashes — these plaintext codes will never be displayed again.

SHOWN ONCE
{% for rc in recovery_once %} {{ rc }} {% endfor %}
{% endif %} {% if enrollment and enrollment.enabled %}

Authenticator Enrolled

Account: {{ current_user.username }} · {{ enrollment.recovery_hashes | length }} unused recovery code(s) remaining

{% if mfa_required_for_user %}
{{ deck_icon("shield-check", 13) }} Superuser MFA enforcement policy is active; two-factor authentication cannot be disabled on this account.
{% else %}
{% endif %}
{% else %}

1. Scan QR Code

Pure SSR SVG
{{ qr_svg }}
{{ setup_secret }}

2. Confirm Authenticator Code

Scan the QR code with 1Password, Apple Passwords, Authy, or Google Authenticator, then enter the generated 6-digit code to activate MFA.

{% endif %}
{% endblock %}