{# WebAuthn passkeys management partial. Displays the passkeys section in profile settings. :param edited_user: The user being edited. :type edited_user: :class:`~canaille.core.models.User` #}

{% trans %}Passkeys{% endtrans %}

{% if edited_user.webauthn_credentials %}
{% trans count=edited_user.webauthn_credentials|length %} You have {{ count }} passkey configured. {% pluralize %} You have {{ count }} passkeys configured. {% endtrans %}

{% trans %} Passkeys can be used for authentication. {% endtrans %} {% if edited_user.webauthn_credentials|length < 2 %} {% trans %} As they are unrecoverable in case of loss, it is generally recommended to register at least one additional backup key. {% endtrans %} {% endif %}

{% for credential in edited_user.webauthn_credentials %} {% endfor %}
{% trans %}Name{% endtrans %} {% trans %}Registered{% endtrans %} {% trans %}Last used{% endtrans %} {% trans %}Actions{% endtrans %}
{{ credential.created_at|datetimeformat }} {% if credential.last_used_at %} {{ credential.last_used_at|datetimeformat }} {% else %} {% trans %}Never{% endtrans %} {% endif %}
{% if edited_user.webauthn_credentials|length < config.CANAILLE.FIDO_MAX_CREDENTIALS %} {% else %}
{% trans %}Add another key{% endtrans %}
{% endif %}
{% else %}
{% trans %} You have no passkey configured. Click on the following button to register your passkey. {% endtrans %}
{% endif %}