Socket
Socket
Sign inDemoInstall

@theydo/graphql-directive-requires-authentication

Package Overview
Dependencies
14
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.10 to 0.1.11

2

dist/directive.d.ts
import { SchemaDirectiveVisitor } from 'graphql-tools';
export interface RequiresAuthenticationOptions<Context extends any> {
isAuthenticated: (context: Context) => boolean | Promise<boolean>;
throwError?: Error;
throwError?: ((context: Context) => Error) | Error;
}
export default function <T extends any>(options: RequiresAuthenticationOptions<T>): typeof SchemaDirectiveVisitor;

@@ -69,2 +69,3 @@ "use strict";

_this.resolver = function (_, _args, context) { return __awaiter(_this, void 0, void 0, function () {
var formattedError;
return __generator(this, function (_a) {

@@ -75,2 +76,3 @@ switch (_a.label) {

if (!(_a.sent())) {
formattedError = typeof error === 'function' ? error(context) : error;
throw error;

@@ -77,0 +79,0 @@ }

{
"name": "@theydo/graphql-directive-requires-authentication",
"version": "0.1.10",
"version": "0.1.11",
"description": "GraphQL directive for checking authentication through context",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc