Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nestlab/google-recaptcha

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestlab/google-recaptcha - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

decorators/recaptcha-result.d.ts

6

guards/google-recaptcha.guard.js

@@ -43,7 +43,7 @@ "use strict";

const action = options === null || options === void 0 ? void 0 : options.action;
const result = await this.validator.validate({ response, score, action });
if (result.success) {
request.recaptchaValidationResult = await this.validator.validate({ response, score, action });
if (request.recaptchaValidationResult.success) {
return true;
}
throw new google_recaptcha_exception_1.GoogleRecaptchaException(result.errors);
throw new google_recaptcha_exception_1.GoogleRecaptchaException(request.recaptchaValidationResult.errors);
}

@@ -50,0 +50,0 @@ };

import { ErrorCode } from '../enums/error-code';
export interface GoogleRecaptchaValidationResult {
import { VerifyResponseV2 } from './verify-response';
export interface GoogleRecaptchaValidationResult extends VerifyResponseV2 {
success: boolean;
hostname: string;
action?: string;
score?: number;
errors: ErrorCode[];
}
{
"name": "@nestlab/google-recaptcha",
"version": "2.0.3",
"version": "2.0.4",
"description": "Google recaptcha module for NestJS.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -191,2 +191,18 @@ # Google recaptcha module

Get verification result
```typescript
@Controller('feedback')
export class FeedbackController {
@Recaptcha()
@Post('send')
async send(@RecaptchaResult() recaptchaResult: GoogleRecaptchaValidationResult): Promise<any> {
console.log(`Action: ${recaptchaResult.action} Score: ${recaptchaResult.score}`);
// TODO: Your implementation.
}
}
```
If you want use google recaptcha guard in combination with another guards then you can use `@UseGuards` decorator.

@@ -193,0 +209,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc