@envelop/generic-auth 2.0.0 → 3.0.0-alpha-eb81218.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -23
- package/index.mjs +15 -23
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -39,15 +39,11 @@ const useGenericAuth = (options) => {
|
|
|
39
39
|
validateUser,
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return;
|
|
48
|
-
await context.validateUser(context[fieldName], context);
|
|
49
|
-
},
|
|
50
|
-
};
|
|
42
|
+
async onResolverCalled({ args, root, context, info }) {
|
|
43
|
+
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'skipAuth');
|
|
44
|
+
if (authDirectiveNode)
|
|
45
|
+
return;
|
|
46
|
+
await context.validateUser(context[fieldName], context);
|
|
51
47
|
},
|
|
52
48
|
};
|
|
53
49
|
}
|
|
@@ -71,20 +67,16 @@ const useGenericAuth = (options) => {
|
|
|
71
67
|
validateUser,
|
|
72
68
|
});
|
|
73
69
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, authDirectiveNode);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
};
|
|
70
|
+
async onResolverCalled({ args, root, context, info }) {
|
|
71
|
+
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'auth');
|
|
72
|
+
if (authDirectiveNode) {
|
|
73
|
+
await context.validateUser(context[fieldName], context, {
|
|
74
|
+
info,
|
|
75
|
+
context: context,
|
|
76
|
+
args,
|
|
77
|
+
root,
|
|
78
|
+
}, authDirectiveNode);
|
|
79
|
+
}
|
|
88
80
|
},
|
|
89
81
|
};
|
|
90
82
|
}
|
package/index.mjs
CHANGED
|
@@ -35,15 +35,11 @@ const useGenericAuth = (options) => {
|
|
|
35
35
|
validateUser,
|
|
36
36
|
});
|
|
37
37
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return;
|
|
44
|
-
await context.validateUser(context[fieldName], context);
|
|
45
|
-
},
|
|
46
|
-
};
|
|
38
|
+
async onResolverCalled({ args, root, context, info }) {
|
|
39
|
+
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'skipAuth');
|
|
40
|
+
if (authDirectiveNode)
|
|
41
|
+
return;
|
|
42
|
+
await context.validateUser(context[fieldName], context);
|
|
47
43
|
},
|
|
48
44
|
};
|
|
49
45
|
}
|
|
@@ -67,20 +63,16 @@ const useGenericAuth = (options) => {
|
|
|
67
63
|
validateUser,
|
|
68
64
|
});
|
|
69
65
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, authDirectiveNode);
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
};
|
|
66
|
+
async onResolverCalled({ args, root, context, info }) {
|
|
67
|
+
const authDirectiveNode = getDirective(info, options.authDirectiveName || 'auth');
|
|
68
|
+
if (authDirectiveNode) {
|
|
69
|
+
await context.validateUser(context[fieldName], context, {
|
|
70
|
+
info,
|
|
71
|
+
context: context,
|
|
72
|
+
args,
|
|
73
|
+
root,
|
|
74
|
+
}, authDirectiveNode);
|
|
75
|
+
}
|
|
84
76
|
},
|
|
85
77
|
};
|
|
86
78
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/generic-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha-eb81218.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "2.0.0-alpha-eb81218.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|