Skip to content

Commit

Permalink
actually we can do this centrally
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <[email protected]>
  • Loading branch information
BeryJu committed Jan 24, 2025
1 parent 08768d7 commit 48c020b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion authentik/flows/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ def to_redirect(
temp_exec.current_stage_view = final_stage
temp_exec.setup(request, flow.slug)

Check warning on line 160 in authentik/flows/planner.py

View check run for this annotation

Codecov / codecov/patch

authentik/flows/planner.py#L159-L160

Added lines #L159 - L160 were not covered by tests
stage = final_stage(request=request, executor=temp_exec)
return stage.dispatch(request)
response = stage.dispatch(request)

Check warning on line 162 in authentik/flows/planner.py

View check run for this annotation

Codecov / codecov/patch

authentik/flows/planner.py#L162

Added line #L162 was not covered by tests
# Ensure we clean the flow state we have in the session before we redirect away
temp_exec.stage_ok()
return response

Check warning on line 165 in authentik/flows/planner.py

View check run for this annotation

Codecov / codecov/patch

authentik/flows/planner.py#L164-L165

Added lines #L164 - L165 were not covered by tests

get_qs = request.GET.copy()
if request.user.is_authenticated and (
Expand Down
2 changes: 1 addition & 1 deletion authentik/flows/views/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class FlowExecutorView(APIView):

permission_classes = [AllowAny]

flow: Flow
flow: Flow = None

plan: FlowPlan | None = None
current_binding: FlowStageBinding | None = None
Expand Down
4 changes: 2 additions & 2 deletions authentik/providers/oauth2/views/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ def redirect(self, uri: str) -> HttpResponse:
)

challenge.is_valid()
self.executor.stage_ok()

return HttpChallengeResponse(
challenge=challenge,
)
self.executor.stage_ok()

return HttpResponseRedirectScheme(uri, allowed_schemes=[parsed.scheme])

def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
Expand Down

0 comments on commit 48c020b

Please sign in to comment.