Skip to content

Commit

Permalink
Set correct route for SMS resend button
Browse files Browse the repository at this point in the history
During registration, the wrong route was visited for the sms resend
form. That resulted in the form being submitted unsuccessfully. By
testing if the secondfactor id is set (this is never the case when
adding a second RT from the token overview page) we can set the correct
route and params for both scenarios.
  • Loading branch information
MKodde committed Jun 6, 2023
1 parent b365e84 commit 6ed9a66
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ private function handleSmsProofOfPossession(

$command = new VerifySmsRecoveryTokenChallengeCommand();
$command->identity = $identity->id;
$command->resendRoute = 'ss_recovery_token_sms';

$command->resendRoute = 'ss_registration_recovery_token_sms';
$command->resendRouteParameters = ['secondFactorId' => $secondFactorId, 'recoveryTokenId' => null];

if (!$secondFactorId) {
$command->resendRoute = 'ss_recovery_token_sms';
$command->resendRouteParameters = [];
}

$form = $this->createForm(VerifySmsChallengeType::class, $command)->handleRequest($request);

Expand Down

0 comments on commit 6ed9a66

Please sign in to comment.