{% extends "mfa/totp/base.html" %} {% load i18n %} {% load allauth user_extras %}{# TOM Toolkit: user_extras added to allauth's load #} {% comment %} Extends django-allauth's mfa/totp/deactivate_form.html to handle the TOM_MFA_REQUIRED case (i.e. it is forbidden to disable MFA). This template explains that. Upgrade Note: Everything outside the "TOM Toolkit" markers is verbatim from allauth, indented one level deeper to sit inside the added if. When upgrading django-allauth, replace the unmarked content with their new template (re-indented) and re-apply the marked lines. {% endcomment %} {% block head_title %} {% trans "Deactivate Authenticator App" %} {% endblock head_title %} {% block content %} {% mfa_can_be_disabled as user_may_disable %}{# TOM Toolkit addition #} {% if user_may_disable %}{# TOM Toolkit addition: allauth's page below, shown only when disabling is allowed #} {% element h1 %} {% trans "Deactivate Authenticator App" %} {% endelement %} {% element p %} {% blocktranslate %}You are about to deactivate authenticator app based authentication. Are you sure?{% endblocktranslate %} {% endelement %} {% url 'mfa_deactivate_totp' as action_url %} {% element form form=form method="post" action=action_url no_visible_fields=True %} {% slot body %} {% csrf_token %} {% element fields form=form %} {{ form.as_p }} {% endelement %} {% endslot %} {% slot actions %} {% element button tags="danger,delete" type="submit" %} {% trans "Deactivate" %} {% endelement %} {% endslot %} {% endelement %} {# --- TOM Toolkit addition: begin --- #} {% else %} {% element h1 %} Two-Factor Authentication Required {% endelement %} {% element p %} Two-factor authentication is required for your account, so it cannot be disabled. If you need it reset — for example, you lost your authenticator app — contact the administrators of this TOM: they can remove the authenticator so that you can enrol again. {% endelement %} {% url 'mfa_index' as back_url %} {% element button href=back_url tags="outline" %} Back to two-factor settings {% endelement %} {% endif %} {# --- TOM Toolkit addition: end --- #} {% endblock content %}