Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Commit 23da782

Browse files
committed
bugfix for apikey
1 parent 8db6ce3 commit 23da782

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,12 @@ var GraphQLFactoryACLPlugin = function () {
832832
try {
833833
var requiredPerm = _.get(this, 'fieldDef._factoryACL');
834834
var secret = _.get(_this.options, 'secret');
835+
var args = resolverArgs.args,
836+
info = resolverArgs.info;
835837

836838
// if no jwt secret has been provided authentication is disabled
837839
// or if not marked as an ACL continue to the next middleware
840+
838841
if (!requiredPerm || !secret) return next();
839842

840843
// check for system api key
@@ -844,9 +847,6 @@ var GraphQLFactoryACLPlugin = function () {
844847
// otherwise continue acl check
845848
var errors = [];
846849
var GraphQLError = this.graphql.GraphQLError;
847-
var args = resolverArgs.args,
848-
info = resolverArgs.info;
849-
850850
var op = _.get(info, 'operation.operation');
851851
var userIdField = _.get(_this.options, 'userIdField', 'userId');
852852
var schemaName = info.schema._factory.key;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-factory-acl",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "ACL Middleware for GraphQL Factory",
55
"main": "index.js",
66
"scripts": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export default class GraphQLFactoryACLPlugin {
193193
try {
194194
const requiredPerm = _.get(this, 'fieldDef._factoryACL')
195195
const secret = _.get(_this.options, 'secret')
196+
const { args, info } = resolverArgs
196197

197198
// if no jwt secret has been provided authentication is disabled
198199
// or if not marked as an ACL continue to the next middleware
@@ -205,7 +206,6 @@ export default class GraphQLFactoryACLPlugin {
205206
// otherwise continue acl check
206207
const errors = []
207208
const GraphQLError = this.graphql.GraphQLError
208-
const { args, info } = resolverArgs
209209
const op = _.get(info, 'operation.operation')
210210
const userIdField = _.get(_this.options, 'userIdField', 'userId')
211211
const schemaName = info.schema._factory.key

0 commit comments

Comments
 (0)