laravel-google-recaptcha-v3 icon indicating copy to clipboard operation
laravel-google-recaptcha-v3 copied to clipboard

Error: The action is timeout.

Open kallefrombosnia opened this issue 4 years ago • 3 comments

Hello, I have a problem with this error.

I checked every issue here and all of them are timeouts after 2 minutes of page loading, but for me, the problem occurs after page load < 2 minutes. More precisely seconds after js load and submit.

Laravel 8, PHP 7.3.7 My controller:

class ReservationController extends Controller
{
    public function createReservation(Request $request){

         // Here validation fails with timeout message
        $request->validate([
            'room' => 'required|exists:rooms,id',
            'email' => 'required|email',
            'phone' => 'required|max:128',
            'dateReservation' => ['required', new DateInPastCheck, new DateArrivalLeaveCheck],
            'name' => 'required|string|min:3|max:150',
            'g-recaptcha-response' => [new GoogleReCaptchaV3ValidationRule('order')],
        ]);

       // ...
    }
}

But when I test before request validation everything passes normally.

class ReservationController extends Controller
{
    public function createReservation(Request $request){

        dd(GoogleReCaptchaV3::verifyResponse(
            $request->input('g-recaptcha-response'),
            $request->getClientIp()
            )
         ->getMessage());

        // ....
    }
}

kallefrombosnia avatar Feb 23 '21 22:02 kallefrombosnia

I got the same issue. Can I know if someone has solution ?

w99910 avatar Jun 12 '21 09:06 w99910

Need to run this.$refs.captcha.execute(); after the response (success or error) otherwise you are submitting the same token.

nolros avatar Sep 05 '21 23:09 nolros

I got the same issue. Is there anyway to solve this problem with javascript instead of vue ? I have tried

    <script type="text/javascript">
        setInterval(function () {
            refreshReCaptchaV3('sign_in_id', 'sign_in');
        }, 120000);
    </script>

but this still happen

nausixkiz avatar Mar 08 '22 10:03 nausixkiz