@theydo/graphql-directive-requires-authentication
Advanced tools
Comparing version 0.1.6 to 0.1.7
{ | ||
"name": "@theydo/graphql-directive-requires-authentication", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "GraphQL directive for checking authentication through context", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# GraphQL Directive: @requiresAuthentication | ||
This directive will throw an AuthenticationError if the context of the query operation | ||
that implements this directive does not meet the criteria of "being authenticated". | ||
The point of this directive is not to validate JWT tokens, since this is frequently | ||
a project-specific implementation. Instead it is expected that resolving token status | ||
is done in the Apollo getContext hook, where the validated token is used to extend | ||
the context object (user information). | ||
This directive will only assert the "isAuthenticated" status coming from the context | ||
object. | ||
## Usage | ||
@@ -7,0 +12,0 @@ |
10338
34