Skip to content

Commit e2161b9

Browse files
jrushlowweaverryan
authored andcommitted
redirect to check email route on failure
1 parent 4705242 commit e2161b9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Resources/skeleton/resetPassword/ResetPasswordController.tpl.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ private function processSendingPasswordResetEmail(string $emailFormData, MailerI
147147
try {
148148
$resetToken = $this->resetPasswordHelper->generateResetToken($user);
149149
} catch (ResetPasswordExceptionInterface $e) {
150-
$this->addFlash('reset_password_error', sprintf(
151-
'There was a problem handling your password reset request - %s',
152-
$e->getReason()
153-
));
150+
// If you want to tell the user why a reset email was not sent, uncomment
151+
// the lines below and change the redirect to 'app_forgot_password_request'.
152+
// Caution: This may reveal if a user is registered or not.
153+
//
154+
// $this->addFlash('reset_password_error', sprintf(
155+
// 'There was a problem handling your password reset request - %s',
156+
// $e->getReason()
157+
// ));
154158

155-
return $this->redirectToRoute('app_forgot_password_request');
159+
return $this->redirectToRoute('app_check_email');
156160
}
157161

158162
$email = (new TemplatedEmail())

0 commit comments

Comments
 (0)