@nestlab/google-recaptcha
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -5,2 +5,3 @@ "use strict"; | ||
const common_1 = require("@nestjs/common"); | ||
const load_module_1 = require("../helpers/load-module"); | ||
exports.RecaptchaResult = common_1.createParamDecorator((data, context) => { | ||
@@ -12,3 +13,3 @@ var _a, _b, _c, _d; | ||
case 'graphql': | ||
const graphqlModule = this.loadModule('@nestjs/graphql'); | ||
const graphqlModule = load_module_1.loadModule('@nestjs/graphql'); | ||
return (_d = (_c = (_b = (_a = graphqlModule.GqlExecutionContext.create(context).getContext().req) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b._httpMessage) === null || _c === void 0 ? void 0 : _c.req) === null || _d === void 0 ? void 0 : _d.recaptchaValidationResult; | ||
@@ -15,0 +16,0 @@ default: |
{ | ||
"name": "@nestlab/google-recaptcha", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Google recaptcha module for NestJS.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -5,3 +5,2 @@ import { ExecutionContext } from '@nestjs/common'; | ||
resolve<T = any>(context: ExecutionContext, type: ApplicationType): T; | ||
private loadModule; | ||
} |
@@ -12,2 +12,3 @@ "use strict"; | ||
const application_type_1 = require("../enums/application-type"); | ||
const load_module_1 = require("../helpers/load-module"); | ||
let RecaptchaRequestResolver = class RecaptchaRequestResolver { | ||
@@ -20,3 +21,3 @@ resolve(context, type) { | ||
case application_type_1.ApplicationType.GraphQL: | ||
const graphqlModule = this.loadModule('@nestjs/graphql'); | ||
const graphqlModule = load_module_1.loadModule('@nestjs/graphql'); | ||
return (_c = (_b = (_a = graphqlModule.GqlExecutionContext.create(context).getContext().req) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b._httpMessage) === null || _c === void 0 ? void 0 : _c.req; | ||
@@ -27,11 +28,2 @@ default: | ||
} | ||
loadModule(moduleName) { | ||
try { | ||
return require(moduleName); | ||
} | ||
catch (e) { | ||
common_1.Logger.error(`Module '${moduleName}' not found. \nPotential solution npm i ${moduleName}`); | ||
throw e; | ||
} | ||
} | ||
}; | ||
@@ -38,0 +30,0 @@ RecaptchaRequestResolver = __decorate([ |
Sorry, the diff of this file is not supported yet
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
56466
70
602