Skip to content

Commit

Permalink
stages/user_login: fix ?next parameter not carried through broken ses…
Browse files Browse the repository at this point in the history
…sion binding (goauthentik#10301)

Signed-off-by: Jens Langhammer <[email protected]>
  • Loading branch information
BeryJu authored Jun 29, 2024
1 parent 136b7de commit c517d46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions authentik/stages/user_login/middleware.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Sessions bound to ASN/Network and GeoIP/Continent/etc"""

from django.conf import settings
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.signals import user_logged_out
from django.contrib.auth.views import redirect_to_login
from django.http.request import HttpRequest
from django.shortcuts import redirect
from structlog.stdlib import get_logger

from authentik.core.models import AuthenticatedSession
Expand Down Expand Up @@ -87,7 +86,7 @@ def process_request(self, request: HttpRequest):
AuthenticationMiddleware(lambda request: request).process_request(request)
logout_extra(request, exc)
request.session.clear()
return redirect(settings.LOGIN_URL)
return redirect_to_login(request.get_full_path())
return None

def recheck_session(self, request: HttpRequest):
Expand Down

0 comments on commit c517d46

Please sign in to comment.