{% extends "base.html" %} {% block body %} {% if user %} {# Only admins may edit usernames and admin status #}
{{ gettext('Back to admin interface') }}
{{ gettext('SecureDrop uses automatically generated diceware passwords.') }}
{{ gettext('Your password will be changed immediately, so you will need to save it before pressing the "Reset Password" button.') }}
{% if user and g.user != user %} {% set password_reset_url = url_for('admin.new_password', user_id=user.id) %} {% else %} {% set password_reset_url = url_for('account.new_password') %}{{ gettext('Please enter your current password and two-factor code.') }}
{% endif %}{{ gettext("If a user's two-factor authentication credentials have been lost or compromised, you can reset them here. If you do this, make sure the user is present and ready to set up their device with the new two-factor credentials. Otherwise, they will be locked out of their account.") }}
{% else %}{{ gettext('If your two-factor authentication credentials have been lost or compromised, or you got a new device, you can reset your credentials here. If you do this, make sure you are ready to set up your new device, otherwise you will be locked out of your account.') }}
{% endif %}{{ gettext('To reset two-factor authentication for mobile apps such as FreeOTP, choose the first option. For hardware tokens like the YubiKey, choose the second one.') }}
{% if user %} {% set totp_reset_url = url_for('admin.reset_two_factor_totp') %} {% set hotp_reset_url = url_for('admin.reset_two_factor_hotp') %} {% else %} {% set totp_reset_url = url_for('account.reset_two_factor_totp') %} {% set hotp_reset_url = url_for('account.reset_two_factor_hotp') %} {% endif %} {% macro twofa_reset(user, reset_url, type, tooltip_text, button_text) %} {% if user %} {% set username = user.username %} {% else %} {% set username = g.user.username %} {% endif %} {%- endmacro %} {{ twofa_reset(user, totp_reset_url, "totp", gettext("Reset two-factor authentication for mobile apps, such as FreeOTP"), gettext("RESET APP TOKEN"))}} {{ twofa_reset(user, hotp_reset_url, "hotp", gettext("Reset two-factor authentication for hardware tokens, like a YubiKey"), gettext("RESET HARDWARE TOKEN"))}} {% endblock %}