From ec0ea7ff0025cd08ea85020a7a8de5a5461af333 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 14 Oct 2025 14:53:14 +0200 Subject: [PATCH] Use gone http exception for outdated recover links --- Controller/UserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/UserController.php b/Controller/UserController.php index 22ce0f8..15da194 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -20,6 +20,7 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\HttpKernel\Exception\GoneHttpException; use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mime\Address; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -387,7 +388,7 @@ class UserController extends AbstractController { if ($pass != $this->slugger->hash($user->getPassword())) { //Throw not found //XXX: prevent use of outdated recover link - throw $this->createNotFoundException($this->translator->trans('Outdated recover link', [], $this->alias)); + throw new GoneHttpException($this->translator->trans('Outdated recover link', [], $this->alias)); } //Set context -- 2.41.3