@envelop/generic-auth
Advanced tools
Comparing version 2.0.1-alpha-a408263.0 to 3.0.0-alpha-dc1e98d.0
38
index.js
@@ -42,11 +42,7 @@ 'use strict'; | ||
}, | ||
onExecute() { | ||
return { | ||
async onResolverCalled({ args, root, context, info }) { | ||
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'skipAuth'); | ||
if (authDirectiveNode) | ||
return; | ||
await context.validateUser(context[fieldName], context); | ||
}, | ||
}; | ||
async onResolverCalled({ args, root, context, info }) { | ||
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'skipAuth'); | ||
if (authDirectiveNode) | ||
return; | ||
await context.validateUser(context[fieldName], context); | ||
}, | ||
@@ -75,16 +71,12 @@ }; | ||
}, | ||
onExecute() { | ||
return { | ||
async onResolverCalled({ args, root, context, info }) { | ||
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'auth'); | ||
if (authDirectiveNode) { | ||
await context.validateUser(context[fieldName], context, { | ||
info, | ||
context: context, | ||
args, | ||
root, | ||
}, authDirectiveNode); | ||
} | ||
}, | ||
}; | ||
async onResolverCalled({ args, root, context, info }) { | ||
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'auth'); | ||
if (authDirectiveNode) { | ||
await context.validateUser(context[fieldName], context, { | ||
info, | ||
context: context, | ||
args, | ||
root, | ||
}, authDirectiveNode); | ||
} | ||
}, | ||
@@ -91,0 +83,0 @@ }; |
{ | ||
"name": "@envelop/generic-auth", | ||
"version": "2.0.1-alpha-a408263.0", | ||
"version": "3.0.0-alpha-dc1e98d.0", | ||
"sideEffects": false, | ||
"peerDependencies": { | ||
"@envelop/core": "1.7.1-alpha-a408263.0", | ||
"@envelop/core": "2.0.0-alpha-dc1e98d.0", | ||
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" | ||
@@ -8,0 +8,0 @@ }, |
Sorry, the diff of this file is not supported yet
18689
233