Missing input secret when it passed

why i got missing-input-secret?
secret key is consoled correctly

router.post("/login", async (req, res) => {
  const token = req.body.token;
  await axios
    .post(
      `https://challenges.cloudflare.com/turnstile/v0/siteverify?secret=${encodeURIComponent(
        `${process.env.CLOUDFLARE_TURNSTILE_SECRET_KEY}`
      )}&response=${encodeURIComponent(token)}`
    )
    .then(async (response) => {
      
      console.log(response.data);
      console.log(encodeURIComponent(`${process.env.CLOUDFLARE_TURNSTILE_SECRET_KEY}`)
      );

      if (response.data.success) {
       ...
       ...
      } else console.log("Hmmm... You're bot!!!");
    });
});

You should be sending a FormData or JSON body rather than using query parameters.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.