|
| 1 | +{% extends "mfa/base_manage.html" %} |
| 2 | + |
| 3 | +{# https://github.com/pennersr/django-allauth/blob/main/allauth/templates/mfa/index.html #} |
| 4 | + |
| 5 | + |
| 6 | +{% load allauth %} |
| 7 | +{% load i18n %} |
| 8 | + |
| 9 | + |
| 10 | +{% block content %} |
| 11 | + |
| 12 | + <h1>{% block heading %}{% trans "MFA" %}{% endblock heading %}</h1> |
| 13 | + |
| 14 | + <p>{% trans 'Configure or update your multi-factor authentication settings.' %}</p> |
| 15 | + |
| 16 | + |
| 17 | + {% if "totp" in MFA_SUPPORTED_TYPES %} |
| 18 | + |
| 19 | + <section class="my-5" id="mfa-totp"> |
| 20 | + <h3>{% trans "Authenticator App" %}</h3> |
| 21 | + |
| 22 | + {% url 'mfa_deactivate_totp' as deactivate_url %} |
| 23 | + {% url 'mfa_activate_totp' as activate_url %} |
| 24 | + |
| 25 | + {% if authenticators.totp %} |
| 26 | + <p> |
| 27 | + {% blocktrans trimmed %} |
| 28 | + Two-factor authentication using an authenticator app is enabled. |
| 29 | + {% endblocktrans %} |
| 30 | + </p> |
| 31 | + <p class="mb-0"><a href="{{ deactivate_url }}" class="btn btn-sm btn-danger">{% trans 'Deactivate MFA' %}</a></p> |
| 32 | + <p class="small text-muted">{% trans '(You will have a chance to confirm)' %}</p> |
| 33 | + {% else %} |
| 34 | + <p> |
| 35 | + {% blocktrans trimmed %} |
| 36 | + Two-factor authentication using an authenticator app is not enabled. |
| 37 | + {% endblocktrans %} |
| 38 | + </p> |
| 39 | + <p><a href="{{ activate_url }}" class="btn btn-sm btn-outline-primary">{% trans 'Activate MFA' %}</a></p> |
| 40 | + {% endif %} |
| 41 | + </section> |
| 42 | + |
| 43 | + {% endif %} |
| 44 | + |
| 45 | + {% block mfa_webauthn %} |
| 46 | + {% if "webauthn" in MFA_SUPPORTED_TYPES %} |
| 47 | + {# TODO if we end up supporting webauthn/passkeys this in the future, this section will need ported #} |
| 48 | + {% endif %} |
| 49 | + {% endblock mfa_webauthn %} |
| 50 | + |
| 51 | + {% block mfa_recovery %} |
| 52 | + {% if is_mfa_enabled and "recovery_codes" in MFA_SUPPORTED_TYPES %} |
| 53 | + |
| 54 | + <section class="my-5" id="mfa-codes"> |
| 55 | + <h3>{% translate "Recovery Codes" %}</h3> |
| 56 | + |
| 57 | + <p> |
| 58 | + {% blocktrans trimmed %} |
| 59 | + Recovery codes are one-time use codes that can be used as backup two-factor authentication codes. |
| 60 | + {% endblocktrans %} |
| 61 | + </p> |
| 62 | + |
| 63 | + {% url 'mfa_view_recovery_codes' as view_url %} |
| 64 | + <a href="{{ view_url }}" class="btn btn-sm btn-outline-primary">{% trans "Manage recovery codes" %}</a> |
| 65 | + </section> |
| 66 | + |
| 67 | + {% endif %} |
| 68 | + {% endblock mfa_recovery %} |
| 69 | +{% endblock content %} |
0 commit comments