Skip to content

Commit 986b926

Browse files
authored
Redirect to login when requesting resetting password with invalid / old token
If the reset password token has already been used, clicking the original link will produce 404 page, would be better just to redirect to login page
1 parent 75f40e0 commit 986b926

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Controller/ResettingController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function resetAction(Request $request, $token)
146146
$user = $userManager->findUserByConfirmationToken($token);
147147

148148
if (null === $user) {
149-
throw new NotFoundHttpException(sprintf('The user with "confirmation token" does not exist for value "%s"', $token));
149+
return new RedirectResponse($this->container->get('router')->generate('fos_user_security_login'));
150150
}
151151

152152
$event = new GetResponseUserEvent($user, $request);

0 commit comments

Comments
 (0)