Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix password reset form not working in local environments #1438

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Controller/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function checkEmail(): Response
* Validates and process the reset URL that the user clicked in their email.
*/
#[Route(path: '/reset-password/reset/{token}', name: 'do_pwd_reset')]
public function reset(Request $request, UserPasswordHasherInterface $passwordHasher, UserChecker $userChecker, UserAuthenticatorInterface $userAuthenticator, BruteForceLoginFormAuthenticator $authenticator, ?string $token = null): Response
public function reset(Request $request, UserPasswordHasherInterface $passwordHasher, UserChecker $userChecker, UserAuthenticatorInterface $userAuthenticator, BruteForceLoginFormAuthenticator $authenticator, bool $recaptchaEnabled, ?string $token = null): Response
{
if (null === $token) {
throw $this->createNotFoundException('No reset password token found in the URL or in the session.');
Expand Down Expand Up @@ -135,6 +135,7 @@ public function reset(Request $request, UserPasswordHasherInterface $passwordHas

return $this->render('reset_password/reset.html.twig', [
'resetForm' => $form,
'requiresRecaptcha' => $recaptchaEnabled,
]);
}

Expand Down
2 changes: 0 additions & 2 deletions templates/reset_password/request.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{% extends 'user/layout.html.twig' %}

{% set requiresRecaptcha = true %}

{% block title %}Reset your password - {{ parent() }}{% endblock %}

{% block user_content %}
Expand Down