From b8188708dccd6be44745dc2cdaecd9617cd63366 Mon Sep 17 00:00:00 2001 From: Jens L Date: Wed, 10 Jul 2024 14:57:02 +0200 Subject: [PATCH] core: fix source flow_manager not resuming flow when linking (#10436) Signed-off-by: Jens Langhammer --- authentik/core/sources/flow_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentik/core/sources/flow_manager.py b/authentik/core/sources/flow_manager.py index d30802257a..9391efda12 100644 --- a/authentik/core/sources/flow_manager.py +++ b/authentik/core/sources/flow_manager.py @@ -212,7 +212,7 @@ class SourceFlowManager: def _prepare_flow( self, - flow: Flow, + flow: Flow | None, connection: UserSourceConnection, stages: list[StageView] | None = None, **kwargs, @@ -309,6 +309,8 @@ class SourceFlowManager: # When request isn't authenticated we jump straight to auth if not self.request.user.is_authenticated: return self.handle_auth(connection) + if SESSION_KEY_OVERRIDE_FLOW_TOKEN in self.request.session: + return self._prepare_flow(None, connection) connection.save() Event.new( EventAction.SOURCE_LINKED,