Skip to content

Commit

Permalink
Simplified logic and used named routes again
Browse files Browse the repository at this point in the history
  • Loading branch information
parijke committed Dec 16, 2023
1 parent 12bdf18 commit 8fc916d
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit 8fc916d

Please sign in to comment.