Skip to content

Commit

Permalink
fill requiresRecaptcha for registration from env variable (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
pscheit authored Mar 14, 2024
1 parent b14fe1b commit e21b71a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Controller/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(private EmailVerifier $emailVerifier)
}

#[Route(path: '/register/', name: 'register')]
public function register(Request $request, UserPasswordHasherInterface $passwordHasher, string $mailFromEmail, string $mailFromName, RecaptchaVerifier $recaptchaVerifier): Response
public function register(Request $request, UserPasswordHasherInterface $passwordHasher, string $mailFromEmail, string $mailFromName, RecaptchaVerifier $recaptchaVerifier, bool $recaptchaEnabled): Response
{
if ($this->getUser()) {
return $this->redirectToRoute('home');
Expand Down Expand Up @@ -87,6 +87,7 @@ public function register(Request $request, UserPasswordHasherInterface $password

return $this->render('registration/register.html.twig', [
'registrationForm' => $form,
'requiresRecaptcha' => $recaptchaEnabled,
]);
}

Expand Down
2 changes: 0 additions & 2 deletions templates/registration/register.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 %}Create account - {{ parent() }}{% endblock %}

{% block user_content %}
Expand Down

0 comments on commit e21b71a

Please sign in to comment.