{% extends 'security/login_user.html' %} {% macro _render_field_with_errors(field) %}

{{ field.label }} {{ field(**kwargs)|safe }} {% if field.errors %}

{% endif %}

{% endmacro %} {% macro render_field(field) %}

{{ field(**kwargs)|safe }}

{% endmacro %} {% macro render_field_errors(field) %}

{% if field and field.errors %}

{% endif %}

{% endmacro %} {% block page_header %}
{{ _("Two-factor authentication adds an extra layer of security to your account") }}
{{ _("In addition to your username and password, you'll need to use a code that we will send you") }}
{%endblock%} {% block page_content %}
{{ two_factor_setup_form.hidden_tag() }} {% for subfield in two_factor_setup_form.setup %} {% if subfield.data in choices %} {{ _render_field_with_errors(subfield) }} {% endif %} {% endfor %} {{ render_field_errors(two_factor_setup_form.setup) }} {{ render_field(two_factor_setup_form.submit) }} {% if chosen_method=="email" and chosen_method in choices %}

{{ _("To complete logging in, please enter the code sent to your mail") }}

{% endif %} {% if chosen_method=="authenticator" and chosen_method in choices %}

{{ _("Open your authenticator app on your device and scan the following qrcode to start receiving codes:") }}

{{ _(

{% endif %} {% if chosen_method=="sms" and chosen_method in choices %}

{{ _("To Which Phone Number Should We Send Code To?") }}

{{ two_factor_setup_form.hidden_tag() }} {{ render_field_with_errors(two_factor_setup_form.phone, placeholder="enter phone number") }} {{ render_field(two_factor_setup_form.submit) }} {% endif %}
{{ two_factor_verify_code_form.hidden_tag() }} {{ render_field_with_errors(two_factor_verify_code_form.code) }} {{ render_field(two_factor_verify_code_form.submit) }}
{% include "security/_menu.html" %} {% endblock %}