From f5c8cda2228683ea0605c57b69e2c0022109bdb7 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Mon, 8 Sep 2025 10:37:22 +0200 Subject: [PATCH] Login page didn't respect the next parameter, bad UX. Fixed. --- ivatar/ivataraccount/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ivatar/ivataraccount/views.py b/ivatar/ivataraccount/views.py index 15ac030..3b03d90 100644 --- a/ivatar/ivataraccount/views.py +++ b/ivatar/ivataraccount/views.py @@ -1109,6 +1109,10 @@ class IvatarLoginView(LoginView): """ if request.user: if request.user.is_authenticated: + # Respect the 'next' parameter if present + next_url = request.GET.get("next") + if next_url: + return HttpResponseRedirect(next_url) return HttpResponseRedirect(reverse_lazy("profile")) return super().get(self, request, args, kwargs)