title: I got "timeout-or-duplicate" error using ReCaptcha v3
body: <p>I got a contact form on my website on Laravel and I'd like to place a ReCaptcha v3 but for now the result I got from the verification is the error "timeout-or-duplicate".</p>
  
  <p>Can you help me from A to Z ? I don't know where to go...</p>
  
  <p>My head : </p>
  
  <pre><code>&lt;script src="https://www.google.com/recaptcha/api.js?render=My_Site_Key"&gt;&lt;/script&gt;
    &lt;script&gt;
      grecaptcha.ready(function () {
        grecaptcha.execute('My_Site_Key', { action: 'contact' }).then(function (token) {
          var recaptchaResponse = document.getElementById('recaptchaResponse');
            recaptchaResponse.value = token;
        });
      });
    &lt;/script&gt;
  </code></pre>
  
  <p>The contact form :</p>
  
  <pre><code>&lt;form action="{{ route('contact.post') }}" id="contact-form" method="post" name="contactForm"&gt;
     &lt;input type="hidden" name="_token" id="token" value="{{ csrf_token() }}"&gt;
     &lt;input type="hidden" name="recaptcha_response" id="recaptchaResponse"&gt;
     &lt;fieldset&gt;
       &lt;div class="col-sm-12"&gt;
         &lt;input id="name" name="name" placeholder="Nom*" type="text"&gt;
       &lt;/div&gt;
       &lt;div class="col-sm-12"&gt;
         &lt;input id="email" name="email" placeholder="Email*" type="text"&gt;
       &lt;/div&gt;
       &lt;div class="col-sm-12"&gt;
         &lt;input id="object" name="object" placeholder="Objet*" type="text" autocomplete="off"&gt;
       &lt;/div&gt;
       &lt;div class="col-xs-12"&gt;
         &lt;textarea cols="5" id="message" name="message" placeholder="Votre message...*"&gt;&lt;/textarea&gt;
       &lt;/div&gt;
       &lt;div class="col-xs-12"&gt;
         &lt;button class="submit active" id="contact-submit"&gt;ENVOYER&lt;/button&gt;
       &lt;/div&gt;
       &lt;div class="error col-xs-12"&gt;
         &lt;h3&gt;&lt;/h3&gt;
       &lt;/div&gt;
       &lt;div class="success col-xs-12"&gt;
         &lt;h3&gt;Merci ! Votre message a été envoyé !&lt;/h3&gt;
       &lt;/div&gt;
     &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::post('/contact', array('as' =&gt; 'contact.post', 'uses' =&gt; 'ContactController@send'));
  </code></pre>
  
  <p>The Contact Controller : </p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use Illuminate\Http\Request;
  use App\Http\Requests;
  use Illuminate\Support\Facades\Input;
  use Illuminate\Support\Facades\Mail;
  
  class ContactController extends Controller
  {
      public function send() {
        $info = array(
            'name' =&gt; Input::get('name'),
            'email' =&gt; Input::get('email'),
            'object' =&gt; Input::get('object'),
            'message' =&gt; Input::get('message')
        );
        if($info['name'] == "" || $info['email'] == "" || $info['object'] == "" || $info['message'] == "") {
            return json_encode(['response' =&gt; 'Tous les champs doivent être remplis !']);
        }
        if(!filter_var($info['email'], FILTER_VALIDATE_EMAIL)) {
            return json_encode(['response' =&gt; 'Vous devez rentrer une adresse e-mail valide !']);
        }
        $ip = Request()-&gt;ip();
  
        // Build POST request:
        $recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
        $recaptcha_secret = 'My_Secret_Key';
        $recaptcha_response = $_POST['recaptcha_response'];
        // Make and decode POST request:
        $recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&amp;response=' . $recaptcha_response);
        $recaptcha = json_decode($recaptcha);
        // Take action based on the score returned:
        if ($recaptcha-&gt;score &lt; 0.5) {
            return json_encode(['response' =&gt; 'Vous êtes considéré comme Bot/Spammer !', 'score' =&gt; $recaptcha-&gt;score]);
        }
  
        Mail::send(['email.html.contact', 'email.text.contact'], ['info' =&gt; $info, 'ip' =&gt; $ip], function($message) use ($info) {
            $message-&gt;to('contact@bryangossuin.be')-&gt;subject('Bryan Gossuin | Formulaire de contact');
            $message-&gt;replyTo($info['email'], $info['name']);
        });
        return json_encode(['response' =&gt; 'success','']);
    }
  }
  </code></pre>
  
  <p>Finaly the javascript</p>
  
  <pre><code>      $('#contact-form').on('submit', function(e) {
            e.preventDefault();
            swal({
                title: "Souhaitez-vous vraiment envoyer ce mail ?",
                icon: "warning",
                buttons: {
                  cancel: {
                    text: "Annuler",
                    value: false,
                    visible: true,
                    closeModal: true,
                  },
                  confirm: "Envoyer",
                }
              })
              .then((value) =&gt; {
                if (value) {
                    $.ajax({
                            method: "POST",
                            url: "contact",
                            cache: false,
                            data: $(this).serialize(),
                            dataType: 'json',
                            success: function(json) {
                                console.log(json.score);
                                if (json.response == 'success') {
                                    $('#contact-form').trigger("reset");
                                    swal("E-mail envoyé", "Merci de votre demande !", "success");
                                } else {
                                    swal("Erreur !", json.response, "error");
                                }
                            }
                        }
                    )
                 }
              });
        });
  </code></pre>
  
  <p>The output I got from google is </p>
  
  <pre><code>{
    "success": false,
    "error-codes": [
      "timeout-or-duplicate"
    ]
  }
  </code></pre>
  
  <p>and I expect it to be </p>
  
  <pre><code>{
    "success": true,
    "score" : x,
    "error-codes": '',
  }
  </code></pre>
  
  <hr>
  
  <p>I guess the problem is because the « method post » is used two times because when I Check directly
  On the API Google to verify the user token it show le thé code but right after I refresh the page it show me « timeout or duplicate » but I dont know how to fix this</p>