| 1 |
{% extends "mfa/webauthn/base.html" %} |
| 2 |
{% load i18n %} |
| 3 |
{% load static %} |
| 4 |
{% load allauth %} |
| 5 |
{% block content %} |
| 6 |
{% element h1 %} |
| 7 |
{% trans "Add Security Key" %} |
| 8 |
{% endelement %} |
| 9 |
{% url 'mfa_add_webauthn' as action_url %} |
| 10 |
{% element form form=form method="post" action=action_url %} |
| 11 |
{% slot body %} |
| 12 |
{% csrf_token %} |
| 13 |
{% element fields form=form %} |
| 14 |
{% endelement %} |
| 15 |
{% endslot %} |
| 16 |
{% slot actions %} |
| 17 |
{% element button id="mfa_webauthn_add" type="button" %} |
| 18 |
{% trans "Add" %} |
| 19 |
{% endelement %} |
| 20 |
{% endslot %} |
| 21 |
{% endelement %} |
| 22 |
{% include "mfa/webauthn/snippets/scripts.html" %} |
| 23 |
{{ js_data|json_script:"js_data" }} |
| 24 |
<script data-allauth-onload="allauth.webauthn.forms.addForm" type="application/json">{ |
| 25 |
"ids": { |
| 26 |
"add": "mfa_webauthn_add", |
| 27 |
"passwordless": "{{ form.passwordless.auto_id }}", |
| 28 |
"credential": "{{ form.credential.auto_id }}", |
| 29 |
"data": "js_data" |
| 30 |
} |
| 31 |
} |
| 32 |
</script> |
| 33 |
{% endblock %} |