From 8fc916d81e0ae6844856943f8376e42a0874d495 Mon Sep 17 00:00:00 2001 From: Paul Rijke Date: Sat, 16 Dec 2023 13:35:16 +0100 Subject: [PATCH] Simplified logic and used named routes again --- .../Controller/EntryPointController.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php index 71b676197..6028d6200 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/EntryPointController.php @@ -42,17 +42,10 @@ public function decideSecondFactorFlow() : RedirectResponse $identity = $this->getIdentity(); $hasSecondFactor = $this->secondFactorService->doSecondFactorsExistForIdentity($identity->id); $hasRecoveryToken = $this->recoveryTokenService->hasRecoveryToken($identity); - $current = '/'; - if (!is_null($this->authStateHandler->getCurrentRequestUri())) { - $current = $this->authStateHandler->getCurrentRequestUri(); - } - $this->activationFlowService->process($current); - if ($hasSecondFactor || $hasRecoveryToken) { - return $this->redirect($this->generateUrl('ss_second_factor_list')); - } else { - return $this->redirect( - $this->generateUrl('ss_registration_display_types') - ); - } + $this->activationFlowService->process($this->authStateHandler->getCurrentRequestUri()); + + return $hasSecondFactor || $hasRecoveryToken + ? $this->redirectToRoute('ss_second_factor_list') + : $this->redirectToRoute('ss_registration_display_types'); } }