From 4d88af4601d3b604e8b5343b52baf587528ef361 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 24 Mar 2021 12:47:12 +0100 Subject: [PATCH] flows: fix RedirectChallenge wrapper being confused by querystrings Signed-off-by: Jens Langhammer --- authentik/flows/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/authentik/flows/views.py b/authentik/flows/views.py index 59664fbe1..7d62e6a7f 100644 --- a/authentik/flows/views.py +++ b/authentik/flows/views.py @@ -316,9 +316,13 @@ def to_stage_response(request: HttpRequest, source: HttpResponse) -> HttpRespons if isinstance(source, HttpResponseRedirect) or source.status_code == 302: redirect_url = source["Location"] # Redirects to the same URL usually indicate an Error within a form - if request.path == redirect_url: + if request.get_full_path() == redirect_url: return source - LOGGER.debug("converting to redirect challenge", to=str(redirect_url)) + LOGGER.debug( + "converting to redirect challenge", + to=str(redirect_url), + current=request.path, + ) return HttpChallengeResponse( RedirectChallenge( {"type": ChallengeTypes.redirect, "to": str(redirect_url)}