{# Second-factor widgets shared by the profile page and the forced setup page. Needs: sec, setup, post_url #} {% set fct = sec.factors %}

Security keys and passkeys

The strongest option: a YubiKey or another FIDO2 key, or a passkey saved in Touch ID, Windows Hello, an Android phone or iCloud Keychain.

{% if fct.webauthn_keys %}{{ fct.webauthn_keys|length }} added{% endif %}
{% if fct.webauthn_keys %}
{% for k in fct.webauthn_keys %} {% endfor %}
{{ m.icon("key") }} {{ k.name }} Added {{ k.created|time }}{% if k.last_used %}, last used {{ k.last_used|ago }}{% else %}, not used yet{% endif %}
{{ m.csrf_field() }}
{% endif %}

Works when the panel is opened by its domain name over HTTPS with a trusted certificate.

Authenticator app

6-digit codes from Google Authenticator, Aegis, 1Password or a similar app.

{% if user.totp_enabled %}On{% else %}Off{% endif %}
{% if user.totp_enabled %}
{{ m.csrf_field() }}
{% elif setup %}
{% if setup.svg %}
{{ setup.svg|safe }}
{% endif %}

Scan the code with your app, then type the 6 digits it shows.

Or enter this key by hand: {{ setup.secret }} {{ m.copy(setup.secret) }}

{{ m.csrf_field() }}
Cancel
{% else %} {{ m.icon("clock") }}Set up authenticator app {% endif %}
{% if fct.totp or fct.webauthn_keys %}

Recovery codes

One-time codes for when you lose your key or phone. Keep them in a password manager or on paper.

{{ fct.recovery_left }} left
{{ m.csrf_field() }}
{% endif %}