React google recaptcha v3 is not working on mobile device

201 Views Asked by At

I am trying to add react-google-recaptcha-v3 to my react JS project. It's working fine on the computer's browser but when I opened that website on a mobile phone, getting some error. It seems that the following post request is not sent through mobile:

const response = await axios.post("https://www.google.com/recaptcha/api/siteverify", "undefined", {
    params: {
      secret: process.env.RECAPTCHA_SECRET_KEY,
      response: gReCaptchaToken,
    },
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })

Please guide.

0

There are 0 best solutions below