From 05a2de7237fd8c4362cf899719086b5d3291f37e Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 23 Jun 2024 10:29:14 +0200 Subject: [PATCH] feat(auth): update redirect URLs for login and logout Configured default redirection to the homepage upon login and logout actions. This improves user experience by ensuring a consistent landing page post-authentication flow. --- freedoi/accounts/urls.py | 2 +- freedoi/settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/freedoi/accounts/urls.py b/freedoi/accounts/urls.py index ce46f75..c664fc9 100644 --- a/freedoi/accounts/urls.py +++ b/freedoi/accounts/urls.py @@ -10,7 +10,7 @@ urlpatterns = [ SendLoginEmailView.as_view(), name="login", ), - path("logout/", auth_views.LogoutView.as_view(), name="logout"), + path("logout/", auth_views.LogoutView.as_view(next_page="/"), name="logout"), path( "email-sent/", TemplateView.as_view(template_name="accounts/email_sent.html"), diff --git a/freedoi/settings.py b/freedoi/settings.py index 595b4e7..3ae3224 100644 --- a/freedoi/settings.py +++ b/freedoi/settings.py @@ -109,6 +109,8 @@ else: AUTH_USER_MODEL = "accounts.CustomUser" +LOGIN_REDIRECT_URL = "/" + AUTH_PASSWORD_VALIDATORS = [ { "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",