@nestlab/google-recaptcha
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -29,3 +29,3 @@ "use strict"; | ||
const request = context.switchToHttp().getRequest(); | ||
const skip = this.options.skipIf ? await this.options.skipIf() : false; | ||
const skip = this.options.skipIf ? await this.options.skipIf(request) : false; | ||
if (skip) { | ||
@@ -32,0 +32,0 @@ return true; |
import { RecaptchaResponseProvider } from '../types'; | ||
export interface GoogleRecaptchaGuardOptions { | ||
response: RecaptchaResponseProvider; | ||
skipIf?: () => boolean | Promise<boolean>; | ||
skipIf?: (request: any) => boolean | Promise<boolean>; | ||
} |
{ | ||
"name": "@nestlab/google-recaptcha", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Google recaptcha module for NestJS.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -27,3 +27,3 @@ # Google recaptcha module | ||
response: req => req.headers.recaptcha, | ||
skipIf: () => process.env.NODE_ENV !== 'production', | ||
skipIf: async req => process.env.NODE_ENV !== 'production', | ||
useRecaptchaNet: false, | ||
@@ -40,9 +40,9 @@ agent: null | ||
| Property | | Type | Description | | ||
|-------------------|---|----------------------------|-------------| | ||
| `secretKey` | ✔ | string | Google recaptcha secret key | | ||
| `response` | ✔ | (request) => string | Function that returns response (recaptcha token) by request | | ||
| `skipIf` | ✖ | () => boolean | Function that returns true if you need skip check for development or testing | | ||
| `useRecaptchaNet` | ✖ | boolean | If your server has trouble connecting to https://www.google.com. You can use https://recaptcha.net instead, just set true | | ||
| `agent` | ✖ | https.Agent | If you need to use an agent | | ||
| Property | | Type | Description | | ||
|-------------------|---|---------------------------------------------|-------------| | ||
| `secretKey` | ✔ | string | Google recaptcha secret key | | ||
| `response` | ✔ | (request) => string | Function that returns response (recaptcha token) by request | | ||
| `skipIf` | ✖ | (request) => boolean \| Promise\<boolean\> | Function that returns true if you allow the request to skip the recaptcha verification. Useful for involing other check methods (e.g. custom privileged API key) or for development or testing | | ||
| `useRecaptchaNet` | ✖ | boolean | If your server has trouble connecting to https://www.google.com. You can use https://recaptcha.net instead, just set true | | ||
| `agent` | ✖ | https.Agent | If you need to use an agent | | ||
@@ -49,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31987