Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing page for /accounts/2fa/authenticate/ #110

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions allauth_ui/templates/mfa/authenticate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "mfa/authenticate.html" %}
{% load allauth %}
{% load allauth_ui %}
{% load i18n %}
{% block content %}
{% trans "Two-Factor Authentication" as heading %}
{% blocktranslate asvar subheading %}Your account is protected by two-factor authentication. Please enter an authenticator code:{% endblocktranslate %}
{% url 'mfa_authenticate' as action_url %}
{% #container heading=heading subheading=subheading %}
{% translate "Activate" as button_text %}
{% trans "Sign In" as button_text %}
{% #form form=form url=action_url button_text=button_text %}
{% csrf_token %}
{% /form %}
{% if "webauthn" in MFA_SUPPORTED_TYPES %}
<div class="divider"></div>
<h2 class="my-3 text-lg">{% translate "Alternative options" %}</h2>
{% #form form=webauthn_form url=action_url use_default_button="false" %}
<button type="submit" class="btn btn-neutral">{% trans "Use a security key" %}</button>
<a href="{% url "account_login" %}" class="btn btn-accent">{% trans "Cancel" %}</a>
{% csrf_token %}
{% /form %}
{% endif %}
{% /container %}
{{ js_data|json_script:"js_data" }}
{% include "mfa/webauthn/snippets/scripts.html" %}
{# djlint:off #}
<script type="text/javascript">
allauth.webauthn.forms.authenticateForm({
ids: {
authenticate: "mfa_webauthn_authenticate",
credential: "{{ webauthn_form.credential.auto_id }}"
},
data: JSON.parse(document.getElementById('js_data').textContent)
})
</script>
{# djlint:on #}
{% endblock content %}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "django-allauth-ui"
version = "1.3.1"
version = "1.3.1b2"
description = ""
authors = ["Dani Hodovic <[email protected]>"]
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@
USERSESSIONS_TRACK_ACTIVITY = True

MFA_SUPPORTED_TYPES = ["totp", "webauthn", "recovery_codes"]
MFA_TOTP_ISSUER = "AllAuth UI"
Loading