From 55b32721e5fe773bc0411428b73c405bcac2dc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Sun, 17 Dec 2023 21:10:11 +0100 Subject: [PATCH] feat(accounts): note about legacy accounts --- fiesta/apps/accounts/templates/account/login.html | 9 +++++++-- fiesta/apps/accounts/templates/account/signup_form.html | 4 ++++ fiesta/fiesta/settings/auth.py | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fiesta/apps/accounts/templates/account/login.html b/fiesta/apps/accounts/templates/account/login.html index 40b99eab..567a22f2 100644 --- a/fiesta/apps/accounts/templates/account/login.html +++ b/fiesta/apps/accounts/templates/account/login.html @@ -36,13 +36,18 @@

{% trans "Log in" %}

type="checkbox" class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300"> -
- +
Lost Password? + +
+ Coming from fiesta.esncz.org? + Use your original account to log in. +
{# social accounts logins do have their own forms, so it cannot be nested #} diff --git a/fiesta/apps/accounts/templates/account/signup_form.html b/fiesta/apps/accounts/templates/account/signup_form.html index 59b66e06..070dafd4 100644 --- a/fiesta/apps/accounts/templates/account/signup_form.html +++ b/fiesta/apps/accounts/templates/account/signup_form.html @@ -15,6 +15,10 @@

{{ card_title|default:"Create Account" }}

value="{{ redirect_field_value }}" /> {% endif %}
+
+ Coming from fiesta.esncz.org? + Use your original account to log in. +
{% include "fiestaforms/parts/errors.html" with errors=form.non_field_errors %} {% include "fiestaforms/parts/field.html" with bf=form.email errors=form.errors.email %} {% include "fiestaforms/parts/field.html" with bf=form.password1 errors=form.errors.password1 %} diff --git a/fiesta/fiesta/settings/auth.py b/fiesta/fiesta/settings/auth.py index a9c1a8ca..d58c98c1 100644 --- a/fiesta/fiesta/settings/auth.py +++ b/fiesta/fiesta/settings/auth.py @@ -80,10 +80,15 @@ class AuthConfigMixin: # social account settings SOCIALACCOUNT_AUTO_SIGNUP = True # after social login, do not enforce a signup form (only in case of conflict) SOCIALACCOUNT_ADAPTER = "apps.accounts.adapters.SocialAccountAdapter" + + # trust providers when providing email and connect the account to the existing one + SOCIALACCOUNT_EMAIL_AUTHENTICATION = True # general django urls LOGIN_URL = "/auth/login" LOGIN_REDIRECT_URL = "/accounts/after-login" ACCOUNT_LOGIN_ON_PASSWORD_RESET = False # do not autologin after password reset + ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True # logout after password change + ACCOUNT_USERNAME_MIN_LENGTH = 4 # a personal preference