diff --git a/sources/AppBundle/Association/UserMembership/UserService.php b/sources/AppBundle/Association/UserMembership/UserService.php index 85c260350..3d3da4a14 100644 --- a/sources/AppBundle/Association/UserMembership/UserService.php +++ b/sources/AppBundle/Association/UserMembership/UserService.php @@ -15,6 +15,7 @@ use AppBundle\MembershipFee\Entity\Cotisation; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Security\Core\Exception\UserNotFoundException; class UserService { @@ -64,10 +65,15 @@ public function resetPassword(User $user): void */ public function resetPasswordForEmail($email): void { - $user = $this->userRepository->loadUserByEmailOrAlternateEmail($email); - if (null !== $user) { - $this->resetPassword($user); + try { + $user = $this->userRepository->loadUserByEmailOrAlternateEmail($email); + } catch (UserNotFoundException) { + // Email inconnu : on s'arrête sans le signaler, pour ne pas révéler quels + // emails correspondent à un compte. + return; } + + $this->resetPassword($user); } public function sendWelcomeEmail(User $user): bool diff --git a/sources/AppBundle/Controller/Auth/LostPasswordAction.php b/sources/AppBundle/Controller/Auth/LostPasswordAction.php index 6be9aa21c..c21db22f3 100644 --- a/sources/AppBundle/Controller/Auth/LostPasswordAction.php +++ b/sources/AppBundle/Controller/Auth/LostPasswordAction.php @@ -34,9 +34,6 @@ public function __invoke(Request $request): Response return $this->view->render('site/auth/lost_password.html.twig', [ 'form' => $form->createView(), - 'title' => 'Mot de passe perdu', - 'page' => 'motdepasse_perdu', - 'class' => 'panel-page', ]); } } diff --git a/templates/site/auth/lost_password.html.twig b/templates/site/auth/lost_password.html.twig index 1a36578ff..0e34c2490 100644 --- a/templates/site/auth/lost_password.html.twig +++ b/templates/site/auth/lost_password.html.twig @@ -1,36 +1,39 @@ -{% extends 'admin/association/membership/_base.html.twig' %} - -{% block page_title %}{% endblock %} - -{% block page_container_extra_classes %}remove-min-height-from-container-id{% endblock %} - -{% block page_content %} - -