From b82ead1f7d9256d4456044a3caab6623a2e9e26b Mon Sep 17 00:00:00 2001 From: Mara Karagianni Date: Wed, 29 May 2024 14:48:59 +0300 Subject: [PATCH] templates,deps: allauth v.62.0 --- adhocracy-plus/config/settings/base.py | 4 +-- .../account/password_reset_done.html | 19 ++++++++++++ .../templates/account/verification_sent.html | 12 +++++++ .../templates/dummy/authenticate_form.html | 28 +++++++++++++++++ .../socialaccount/authentication_error.html | 12 +++++++ .../templates/socialaccount/login.html | 31 +++++++++++++++++++ .../templates/socialaccount/signup.html | 2 +- changelog/8102.md | 3 ++ requirements/base.txt | 2 +- 9 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 adhocracy-plus/templates/account/password_reset_done.html create mode 100644 adhocracy-plus/templates/account/verification_sent.html create mode 100644 adhocracy-plus/templates/dummy/authenticate_form.html create mode 100644 adhocracy-plus/templates/socialaccount/authentication_error.html create mode 100644 adhocracy-plus/templates/socialaccount/login.html diff --git a/adhocracy-plus/config/settings/base.py b/adhocracy-plus/config/settings/base.py index 3fe7c262c..6aefc2a72 100644 --- a/adhocracy-plus/config/settings/base.py +++ b/adhocracy-plus/config/settings/base.py @@ -37,6 +37,7 @@ "allauth", "allauth.account", "allauth.socialaccount", + "allauth.socialaccount.providers.dummy", "rules.apps.AutodiscoverRulesConfig", "easy_thumbnails", "parler", @@ -284,8 +285,7 @@ "signup": "apps.users.forms.DefaultSignupForm", "login": "apps.users.forms.DefaultLoginForm", } -ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10 -ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300 # seconds +ACCOUNT_RATE_LIMITS = {"login_failed": "10/5m/ip"} ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True ACCOUNT_LOGIN_ON_PASSWORD_RESET = True ACCOUNT_USERNAME_MIN_LENGTH = 5 diff --git a/adhocracy-plus/templates/account/password_reset_done.html b/adhocracy-plus/templates/account/password_reset_done.html new file mode 100644 index 000000000..be1dcf9b9 --- /dev/null +++ b/adhocracy-plus/templates/account/password_reset_done.html @@ -0,0 +1,19 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load allauth %} +{% load account %} + +{% block head_title %} + {% translate "Password Reset" %} +{% endblock head_title %} + +{% block content %} +

{% translate "Password Reset" %}

+ {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} +

+ {% blocktranslate %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktranslate %} +

+{% endblock content %} diff --git a/adhocracy-plus/templates/account/verification_sent.html b/adhocracy-plus/templates/account/verification_sent.html new file mode 100644 index 000000000..ed5042c37 --- /dev/null +++ b/adhocracy-plus/templates/account/verification_sent.html @@ -0,0 +1,12 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% translate "Verify Your E-mail Address" %} +{% endblock head_title %} +{% block content %} +

{% translate "Verify Your E-mail Address" %}

+

+ {% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification e-mail in your main inbox, check your spam folder. Please contact us if you do not receive the verification e-mail within a few minutes.{% endblocktranslate %} +

+{% endblock content %} diff --git a/adhocracy-plus/templates/dummy/authenticate_form.html b/adhocracy-plus/templates/dummy/authenticate_form.html new file mode 100644 index 000000000..6ca66b6c9 --- /dev/null +++ b/adhocracy-plus/templates/dummy/authenticate_form.html @@ -0,0 +1,28 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% translate "Dummy Provider Login" %} +{% endblock head_title %} +{% block content %} + {% element form form=form method="post" action=action_url %} + {% csrf_token %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button type="submit" %} + {% translate "Login" %} + {% endelement %} + {% element button form="cancel-form" type="submit" %} + {% translate "Cancel" %} + {% endelement %} + {% endslot %} + {% endelement %} +
+ {% csrf_token %} + +
+{% endblock %} diff --git a/adhocracy-plus/templates/socialaccount/authentication_error.html b/adhocracy-plus/templates/socialaccount/authentication_error.html new file mode 100644 index 000000000..5528e6dff --- /dev/null +++ b/adhocracy-plus/templates/socialaccount/authentication_error.html @@ -0,0 +1,12 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Third-Party Login Failure" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Third-Party Login Failure" %} + {% endelement %} +

{% trans "An error occurred while attempting to login via your third-party account." %}

+{% endblock content %} diff --git a/adhocracy-plus/templates/socialaccount/login.html b/adhocracy-plus/templates/socialaccount/login.html new file mode 100644 index 000000000..78eec32e8 --- /dev/null +++ b/adhocracy-plus/templates/socialaccount/login.html @@ -0,0 +1,31 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Sign In" %} +{% endblock head_title %} +{% block content %} + {% if process == "connect" %} + {% element h1 %} + {% blocktrans with provider.name as provider %}Connect {{ provider }}{% endblocktrans %} + {% endelement %} +

+ {% blocktrans with provider.name as provider %}You are about to connect a new third-party account from {{ provider }}.{% endblocktrans %} +

+ {% else %} + {% element h1 %} + {% blocktrans with provider.name as provider %}Sign In Via {{ provider }}{% endblocktrans %} + {% endelement %} +

+ {% blocktrans with provider.name as provider %}You are about to sign in using a third-party account from {{ provider }}.{% endblocktrans %} +

+ {% endif %} + {% element form method="post" no_visible_fields=True %} + {% slot actions %} + {% csrf_token %} + {% element button type="submit" %} + {% trans "Continue" %} + {% endelement %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/adhocracy-plus/templates/socialaccount/signup.html b/adhocracy-plus/templates/socialaccount/signup.html index 290b6698c..48dd6dd4b 100644 --- a/adhocracy-plus/templates/socialaccount/signup.html +++ b/adhocracy-plus/templates/socialaccount/signup.html @@ -1,4 +1,4 @@ -{% extends "socialaccount/base.html" %} +{% extends "account/base.html" %} {% load i18n %} diff --git a/changelog/8102.md b/changelog/8102.md index a18358a4d..3fc4692e7 100644 --- a/changelog/8102.md +++ b/changelog/8102.md @@ -2,3 +2,6 @@ - unique email constraint - add social account autoconnect to enable social account email connecting to existing regular account +- add templates for email verification, password reset, socialaccount login, authentication error, and dummy authentication to address the template changes of allauth v.0.58.0 +- remove deprecated settings for account rate limits (removed in allauth v.0.61.0 +- update to allauth v.0.62.0 diff --git a/requirements/base.txt b/requirements/base.txt index bd21a207a..0fe4f6b25 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -16,7 +16,7 @@ redis==5.0.4 # Inherited a4-core requirements Django==4.2.13 -django-allauth==0.57.0 +django-allauth==0.62.0 git+https://github.com/liqd/django-autoslug.git@liqd2212#egg=django-autoslug django-ckeditor==6.7.1 https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.12-liqd/django_ckeditor_5-0.2.12-py3-none-any.whl