Skip to content

Commit

Permalink
fill requiresRecaptcha from env variable for PasswordResetController (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pscheit authored Mar 15, 2024
1 parent e21b71a commit 387f9ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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

0 comments on commit 387f9ef

Please sign in to comment.