Fixed exception when accessing user admin pagee

This commit is contained in:
Jan Böhmer 2022-10-09 21:14:00 +02:00
parent 34573bb5e6
commit e83f14f1ee

View file

@ -54,8 +54,8 @@
{% endif %} {% endif %}
</p> </p>
<p><b>{% trans %}user.edit.tfa.u2f_keys_count{% endtrans %}:</b> <p><b>{% trans %}user.edit.tfa.u2f_keys_count{% endtrans %}:</b>
{% if entity.u2FAuthEnabled %} {% if entity.webAuthnAuthenticatorEnabled %}
{{ entity.u2FKeys | length }} {{ (entity.webauthnKeys | length) + (entity.legacyU2FKeys | length) }}
{% else %} {% else %}
{% trans %}user.edit.tfa.disabled{% endtrans %} {% trans %}user.edit.tfa.disabled{% endtrans %}
{% endif %} {% endif %}
@ -63,7 +63,7 @@
{% set tfa_disable_disabled = not is_granted('set_password', entity) %} {% set tfa_disable_disabled = not is_granted('set_password', entity) %}
{# Disable button when he has no 2FA activated #} {# Disable button when he has no 2FA activated #}
{% if not entity.u2FAuthEnabled and not entity.googleAuthenticatorEnabled and entity.backupCodes is empty %} {% if not entity.webAuthnAuthenticatorEnabled and not entity.googleAuthenticatorEnabled and entity.backupCodes is empty %}
{% set tfa_disable_disabled = true %} {% set tfa_disable_disabled = true %}
{% endif %} {% endif %}