Google reCAPTCHA not working , "Captcha not valid" (Form Plugin v7.4.0)

Hello Grav community,

I’m experiencing an issue with setting up Google reCAPTCHA for the contact form on my site. I’ve configured the form plugin with the correct site key and secret key, and I’ve tried using both the v2 (checkbox) and v3 versions of reCAPTCHA.
When I use the v2 checkbox, I can see the checkbox appear on the form, and with v3, I see the badge on the screen. However, when I submit the form, I always get the error message: “Captcha not valid.”

Here’s the form.md file for my contact page:


title: Contact Form

form:
name: contact

fields:
    name:
      label: Name
      placeholder: Enter your name
      autocomplete: on
      type: text
      validate:
        required: true

    email:
      label: Email
      placeholder: Enter your email address
      type: email
      validate:
        required: true

    message:
      label: Message
      placeholder: Enter your message
      type: textarea
      validate:
        required: true

    g-recaptcha-response:
      label: Captcha
      type: captcha
      recaptcha_not_validated: 'Captcha not valid!'
      validate:
        required: true

buttons:
    submit:
      type: submit
      value: Submit
    reset:
      type: reset
      value: Reset

process:
    captcha: true

    save:
        fileprefix: contact-
        dateformat: Ymd-His-u
        extension: txt
        body: "{% include 'forms/data.txt.twig' %}"
    email:
        subject: "[Site Contact Form] {{ form.value.name|e }}"
        body: "{% include 'forms/data.html.twig' %}"
    message: Thank you for getting in touch!

Did it use to work? Is it working with older version of the plugin? Did you check if it’s not submitting twice by accident?

I previously received alerts about suspicious request activity in the Google reCAPTCHA admin panel, and while it was working fine before, I am now encountering an issue where I receive a “captcha not valid” error, even though I am not submitting the form multiple times.