@nestlab/google-recaptcha
Advanced tools
Changelog
v3.1.8
rxjs
package as peerDependency.Changelog
v3.1.7
Changelog
v3.1.4
Changelog
v3.1.3
RecaptchaVerificationResult.getEnterpriseRiskAnalytics()
.Changelog
v3.1.2
site-mismatch
, browser-error
(HTTP status - 400).incorrect-captcha-sol
.Changelog
v3.1.0
secretKey
as optional (shouldn't use for enterprise configuration).enterprise
option| Property | Description |
|---------------------------------|-------------|
| enterprise.projectId
| Required.<br> Type: string
<br> Google Cloud project ID |
| enterprise.siteKey
| Required.<br> Type: string
<br> reCAPTCHA key associated with the site/app. |
| enterprise.apiKey
| Required.<br> Type: string
<br> API key associated with the current project. <br>Must have permission reCAPTCHA Enterprise API
. <br> You can manage credentials here. |
Updated GoogleRecaptchaValidator interface
class GoogleRecaptchaValidator {
validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<VerifyResponseV3>>;
}
Addded recaptcha validator for enterprise
@Injectable()
export class SomeService {
constructor(private readonly recaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator) {
}
async someAction(recaptchaToken: string): Promise<void> {
const result = await this.recaptchaEnterpriseValidator.validate({
response: recaptchaToken,
score: 0.8,
action: 'SomeAction',
});
if (!result.success) {
throw new GoogleRecaptchaException(result.errors);
}
const riskAnalytics = result.getEnterpriseRiskAnalytics();
console.log('score', riskAnalysis.score);
console.log('score', riskAnalysis.reasons);
// TODO: Your implemetation
}
}