{% extends "base.html" %} {% block tab_title %} {% if user %} {{ gettext('Edit user "{user}"').format(user=user.username) }} {% else %} {{ gettext('Edit your account') }} {% endif %} {% endblock %} {% block body %} {% if user %} {# Only admins may edit usernames and admin status #}
{{ 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 session.get_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') %} {% set legend = 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 security keys 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, button_aria_label) %} {% if user %} {% set username = user.username %} {% else %} {% set username = session.get_user().username %} {% endif %} {%- endmacro %} {{ twofa_reset(user, totp_reset_url, "totp", gettext("Reset two-factor authentication for mobile apps, such as FreeOTP"), gettext("RESET MOBILE APP CREDENTIALS"), gettext('Reset Mobile App Credentials'))}} {{ twofa_reset(user, hotp_reset_url, "hotp", gettext("Reset two-factor authentication for security keys, like a YubiKey"), gettext("RESET SECURITY KEY CREDENTIALS"), gettext('Reset Security Key Credentials'))}}