Skip to content

Commit 6ed9a66

Browse files
committed
Set correct route for SMS resend button
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.
1 parent b365e84 commit 6ed9a66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/RecoveryTokenControllerTrait.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ private function handleSmsProofOfPossession(
121121

122122
$command = new VerifySmsRecoveryTokenChallengeCommand();
123123
$command->identity = $identity->id;
124-
$command->resendRoute = 'ss_recovery_token_sms';
124+
125+
$command->resendRoute = 'ss_registration_recovery_token_sms';
126+
$command->resendRouteParameters = ['secondFactorId' => $secondFactorId, 'recoveryTokenId' => null];
127+
128+
if (!$secondFactorId) {
129+
$command->resendRoute = 'ss_recovery_token_sms';
130+
$command->resendRouteParameters = [];
131+
}
125132

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

0 commit comments

Comments
 (0)