|
|
|
@ -71,7 +71,7 @@ class ResetPasswordController extends AbstractController
|
|
|
|
|
* Validates and process the reset URL that the user clicked in their email.
|
|
|
|
|
*/
|
|
|
|
|
#[Route('/reset/{token}', name: 'app_reset_password')]
|
|
|
|
|
public function reset(Request $request, UserPasswordHasherInterface $passwordHasher, string $token = null): Response
|
|
|
|
|
public function reset(Request $request, UserPasswordHasherInterface $passwordEncoder, string $token = null): Response
|
|
|
|
|
{
|
|
|
|
|
if ($token) {
|
|
|
|
|
// We store the token in session and remove it from the URL, to avoid the URL being
|
|
|
|
@ -106,12 +106,13 @@ class ResetPasswordController extends AbstractController
|
|
|
|
|
$this->resetPasswordHelper->removeResetRequest($token);
|
|
|
|
|
|
|
|
|
|
// Encode the plain password, and set it.
|
|
|
|
|
$encodedPassword = $passwordHasher->encodePassword(
|
|
|
|
|
$user,
|
|
|
|
|
$form->get('plainPassword')->getData()
|
|
|
|
|
$user->setPassword(
|
|
|
|
|
$passwordEncoder->hashPassword(
|
|
|
|
|
$user,
|
|
|
|
|
$form->get('plainPassword')->getData()
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$user->setPassword($encodedPassword);
|
|
|
|
|
$this->getDoctrine()->getManager()->flush();
|
|
|
|
|
|
|
|
|
|
// The session is cleaned up after the password has been changed.
|
|
|
|
|