{% extends "base.html" %} {% block content %}
{# Which controls the mask offers. Signing in: the password form always, the two credential buttons as the site configured them (sso_show_fido2_button / sso_show_tiqr_button). Whether a method may actually be used is sso_allow_fido2 / sso_allow_tiqr, decided ssod-side once the user is known -- these only decide what is drawn. Re-authenticating: the user is known, and so is the token they signed in with. Only the one control that token can answer is drawn. Offering a password field to somebody whose token is a phone or a security key gives them something that cannot succeed, and offering the buttons to somebody who typed a password sends them looking for a device they never enrolled. A pass type we do not recognise -- or a session from before the field existed -- falls back to offering everything, so nobody ends up on a page with no way forward. #} {% if reauth and reauth_token_pass_type %} {% set show_password_form = reauth_token_pass_type not in ('smartcard', 'tiqr') %} {% set show_fido2 = reauth_token_pass_type == 'smartcard' %} {% set show_tiqr = reauth_token_pass_type == 'tiqr' %} {% elif reauth %} {% set show_password_form = true %} {% set show_fido2 = true %} {% set show_tiqr = true %} {% else %} {% set show_password_form = true %} {% set show_fido2 = show_fido2_button %} {% set show_tiqr = show_tiqr_button %} {% endif %}

{% if reauth %}{{ gettext("Re-authenticate") }}{% else %}{{ gettext("Sign In") }}{% endif %}

{% if reauth %}

{{ gettext("Please verify your identity to continue.") }}

{% endif %}
{{ form.hidden_tag() }} {% if reauth %} {{ form.username(size=80, id="username", class="", readonly=true, value=reauth_username) }} {% else %} {{ form.username(size=80, id="username", class="") }} {% endif %} {% for error in form.username.errors %} [{{ error }}] {% endfor %} {# The label follows the token too: an OTP token gets an OTP label rather than being asked for a password it does not have. #} {% if show_password_form %} {{ form.password(size=80, id="password", class="") }} {% for error in form.password.errors %} [{{ error }}] {% endfor %} {% endif %}
{% if not reauth and show_recover_link %} {% endif %}
{% endblock %}