From b9c6264b0e6133a2a7fba6a81d4f3bb2c6aacd70 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 19:26:45 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Improve=20email=20verification?= =?UTF-8?q?=20UX=20on=20login=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Remove always-visible 'Resend email verification' link from login page • Add contextual resend link only when user needs email verification • Clean login page with only relevant links (forgot password, register) • Better user experience - show resend option exactly when needed • Enable HTML rendering in messages for proper link display 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- authentication/views.py | 4 +++- templates/authentication/login.html | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/authentication/views.py b/authentication/views.py index 349655e..291e29a 100644 --- a/authentication/views.py +++ b/authentication/views.py @@ -103,7 +103,9 @@ def login_view(request): if user is not None: # Check if email is verified (only if email verification is required) if settings.REQUIRE_EMAIL_VERIFICATION and not user.email_verified: - messages.warning(request, 'Please verify your email address before logging in. Check your inbox for the verification link.') + from django.urls import reverse + resend_url = reverse('authentication:resend_verification') + messages.warning(request, f'Please verify your email address before logging in. Check your inbox for the verification link, or resend verification email.') return render(request, 'authentication/login.html') login(request, user) diff --git a/templates/authentication/login.html b/templates/authentication/login.html index 7a0852d..ece36ea 100644 --- a/templates/authentication/login.html +++ b/templates/authentication/login.html @@ -132,7 +132,7 @@ {% if messages %}
{% for message in messages %} -
{{ message }}
+
{{ message|safe }}
{% endfor %}
{% endif %} @@ -176,7 +176,6 @@