{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
    {% include "security/_messages.html" %}
    <h1>{{ _fsdomain("Two-factor Authentication") }}</h1>
    <h2>{{ _fsdomain("Please enter your authentication code generated via: %(method)s", method=chosen_method) }}</h2>
    <form action="{{ url_for_security("two_factor_token_validation") }}" method="POST"
          name="two_factor_verify_code_form">
        {{ two_factor_verify_code_form.hidden_tag() }}
        {{ render_field_with_errors(two_factor_verify_code_form.code, placeholder="enter code") }}
        {{ render_field(two_factor_verify_code_form.submit) }}
    </form>
    <hr class="fs-gap">
    <form action="{{ url_for_security("two_factor_rescue") }}" method="POST" name="two_factor_rescue_form">
        {{ two_factor_rescue_form.hidden_tag() }}
        {{ render_field_with_errors(two_factor_rescue_form.help_setup) }}
        {% if problem=="email" %}
            <div>{{ _fsdomain("The code for authentication was sent to your email address") }}</div>
        {% endif %}
        {% if problem=="help" %}
            <div>{{ _fsdomain("A mail was sent to us in order to reset your application account") }}</div>
        {% endif %}
        {{ render_field(two_factor_rescue_form.submit) }}
    </form>
    {% include "security/_menu.html" %}
{% endblock %}
