]> Raphaël G. Git Repositories - userbundle/commitdiff
Use gone http exception for outdated recover links
authorRaphaël Gertz <git@rapsys.eu>
Tue, 14 Oct 2025 12:53:14 +0000 (14:53 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 14 Oct 2025 12:53:14 +0000 (14:53 +0200)
Controller/UserController.php

index 22ce0f8052f5d9166f057379237fdd4bcdf7971a..15da1946475be832e08f351a188cba350dfa5358 100644 (file)
@@ -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\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;
 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
                        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
                        }
 
                        //Set context