Skip to content

Commit d3bf218

Browse files
authored
Merge pull request #2653 from runawaycoin/patch-1
Redirect to login when resetting password with invalid / old token
2 parents 0229aef + 6a8bdf1 commit d3bf218

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Controller/ResettingController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Symfony\Component\HttpFoundation\RedirectResponse;
2424
use Symfony\Component\HttpFoundation\Request;
2525
use Symfony\Component\HttpFoundation\Response;
26-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2726

2827
/**
2928
* Controller managing the resetting of the password.
@@ -146,7 +145,7 @@ public function resetAction(Request $request, $token)
146145
$user = $userManager->findUserByConfirmationToken($token);
147146

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

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

0 commit comments

Comments
 (0)