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

add templates for request and confirm login code #134

Merged
merged 2 commits into from
Feb 13, 2025
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
31 changes: 31 additions & 0 deletions allauth_ui/templates/account/confirm_login_code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{# -*- engine:django -*- #}
{% extends "account/confirm_login_code.html" %}
{% load i18n %}
{% load allauth %}
{% load allauth_ui %}
{% load widget_tweaks %}
{% block content %}
{% trans "Sign In" as heading %}
{% #container heading=heading %}
<div class="py-3">{% blocktranslate %}Enter Sign-In Code{% endblocktranslate %}</div>
<div class="py-3">
{% setvar email_link %}
<a href="mailto:{{ email }}">{{ email }}</a>
{% endsetvar %}
{% blocktranslate %}We’ve sent a code to {{ email_link }}. The code expires shortly, so please enter it soon.{% endblocktranslate %}
</div>
{% url 'account_confirm_login_code' as action_url %}
{% #form form=form url=action_url button_text=heading %}
{{ redirect_field }}
{% csrf_token %}
{% /form %}
<button type="submit" class="btn btn-red" form="logout-from-stage">{% translate "Cancel" %}</button>
<form id="logout-from-stage"
method="post"
action="{% url 'account_logout' %}">
<input type="hidden" name="next" value="{% url 'account_login' %}">
{% csrf_token %}
</form>
{% /container %}
{% endblock content %}
{% comment %}{% endcomment %}
17 changes: 17 additions & 0 deletions allauth_ui/templates/account/request_login_code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "account/request_login_code.html" %}
{% load i18n %}
{% load allauth_ui %}
{% load widget_tweaks %}
{% block content %}
{% trans "Mail me a sign-in code" as heading %}
{% #container heading=heading %}
<div class="py-3">
{% blocktranslate %}You will receive an email containing a special code for a password-free sign-in.{% endblocktranslate %}
</div>
{% url 'account_request_login_code' as action_url %}
{% #form form=form url=action_url button_text=heading %}
{{ redirect_field }}
{% csrf_token %}
{% /form %}
{% /container %}
{% endblock content %}
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 1000
ACCOUNT_LOGIN_BY_CODE_ENABLED = "true"

BASE_DIR = Path(__file__).parent.parent

Expand Down
Loading