google-cloud-node
google-cloud-node copied to clipboard
Score is always 0.8999999761581421, even for automated tests in @google-cloud/recaptcha-enterprise
I've implemented the recaptcha enterprise widget on my site, but the score that returns from the assesment is always the same - 0.8999999761581421 even for my e2e tests which are running via playwright
Environment details
- which product (packages/*): "@google-cloud/recaptcha-enterprise": "^5.9.0",
- OS: Mac/Linux
- Node.js version: v16.18.1
- npm version: 8.19.2
Steps to reproduce
I'm using the code example from their integration example in the gcp console. The token is generated in the frontend.
const { RecaptchaEnterpriseServiceClient } = require('@google-cloud/recaptcha-enterprise');
class ReCaptchaService {
async createAssessment({ ... }) {
const credentials = ...
const client = new RecaptchaEnterpriseServiceClient({ credentials });
const projectPath = client.projectPath(projectID);
const request = {
assessment: {
event: {
token,
siteKey: recaptchaKey,
},
},
parent: projectPath,
};
const [response] = await client.createAssessment(request);