From 9b087730125b38011cabb3c999d28730aea10385 Mon Sep 17 00:00:00 2001 From: Raz Date: Tue, 4 Feb 2025 19:48:16 +0100 Subject: [PATCH 1/2] fix csrf issue --- padelclub_backend/settings.py | 2 ++ tournaments/templates/tournaments/acc_active_email.html | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/padelclub_backend/settings.py b/padelclub_backend/settings.py index 2c5c17e..6184863 100644 --- a/padelclub_backend/settings.py +++ b/padelclub_backend/settings.py @@ -151,5 +151,7 @@ AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', ] +CSRF_COOKIE_SECURE = True # if using HTTPS + from .settings_local import * from .settings_app import * diff --git a/tournaments/templates/tournaments/acc_active_email.html b/tournaments/templates/tournaments/acc_active_email.html index 9bb6300..29e0df7 100644 --- a/tournaments/templates/tournaments/acc_active_email.html +++ b/tournaments/templates/tournaments/acc_active_email.html @@ -4,11 +4,7 @@ Bienvenue {{ user.username }} !

Veuillez cliquer sur le lien suivant pour activer votre compte :
-Activer mon compte - -

Si le lien ne marche pas, cliquez ici. - -
Une fois votre compte activé, connectez-vous dans l'app. +Activer mon compte

À tout de suite sur Padel Club ! {% endautoescape %} From ce9352d2375e142e6a96f70687a69240281e6e6f Mon Sep 17 00:00:00 2001 From: Raz Date: Tue, 4 Feb 2025 20:14:02 +0100 Subject: [PATCH 2/2] fix csrf issue --- .../registration/signup_success.html | 22 ++++++++++++++++--- tournaments/views.py | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/tournaments/templates/registration/signup_success.html b/tournaments/templates/registration/signup_success.html index 0e40cc7..e783bfc 100644 --- a/tournaments/templates/registration/signup_success.html +++ b/tournaments/templates/registration/signup_success.html @@ -10,13 +10,29 @@
- +
- Veuillez vérifier votre e-mail pour confirmer votre compte. +

Un e-mail de confirmation a été envoyé à :
+ {{ user_email }}

+ +

Pour finaliser votre inscription, merci de :

+
    +
  1. Vérifier votre boîte de réception (et vos spams si nécessaire)
  2. +
  3. Cliquer sur le lien de confirmation dans l'e-mail
  4. +
-
+ +
+ + {% endblock %} diff --git a/tournaments/views.py b/tournaments/views.py index 6bdc5ca..c893323 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -635,7 +635,8 @@ def signup(request): send_verification_email(request, user, next_url) return render(request, 'registration/signup_success.html', { - 'next_url': next_url + 'next_url': next_url, + 'user_email': user.email # Add the user's email to the context }) else: form = SimpleCustomUserCreationForm()