EWZRecaptchaBundle icon indicating copy to clipboard operation
EWZRecaptchaBundle copied to clipboard

How to use for login form. Not validate recaptcha

Open ms8779 opened this issue 8 years ago • 4 comments

It is working for my Registration form. I put the same twig code in login twig file. But it allow sign-in without validation recaptcha click. Help me please. I have deadline for project.

ms8779 avatar Dec 19 '17 09:12 ms8779

This is my question too

seddighi78 avatar Jul 14 '18 21:07 seddighi78

same issue ... did you find response ?

syjust avatar Dec 18 '20 08:12 syjust

This issue appears to be a duplicate of https://github.com/excelwebzone/EWZRecaptchaBundle/issues/63 which has an answer in gist: https://gist.github.com/unti1x/eef5aee81d5caf90729fac9239d3b095

rrehbein avatar Mar 10 '21 15:03 rrehbein

Hi :) Super easy to integrate in a regular form but I still can't find a way to integrate it the login form as I don't have a LoginType.php

My login form is coming from: https://symfony.com/doc/current/security.html#form-login

I don't understand how to follow the suggested Gist...

class SecurityController extends AbstractController
{
    /**
     * @Route("/login", name="login", methods={"GET", "POST"})
     * @param AuthenticationUtils $authenticationUtils
     * @return Response
     */
    public function login(AuthenticationUtils $authenticationUtils)
    {
        if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED'))
            return $this->redirectToRoute('home');

        $error = $authenticationUtils->getLastAuthenticationError();

        return $this->render('security/login.html.twig', [
            'error'         => $error,
        ]);
    }

twig:

                    <form action="{{ path('login') }}" method="post">

                        <input id="username" name="_username" class="form-control" type="text" placeholder="Email address" />

                        <input id="password" name="_password" class="form-control" type="password" placeholder="Password" />

                        <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>

                        <button type="submit" name="submit">Log in</button>

                    </form>

EDIT: I'm using the V3 btw.

cedricgeffroy avatar Feb 23 '22 02:02 cedricgeffroy