UNPKG

@accounts/module-core

Version:

Server side GraphQL transport for accounts

20 lines 716 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.authenticated = void 0; const graphql_1 = require("graphql"); const authenticated = (func) => async (root, args, context, info) => { if (context && context.skipJSAccountsVerification === true) { return func(root, args, context, info); } if (!context.userId && !context.user) { throw new graphql_1.GraphQLError('Unauthorized', { extensions: { code: 'UNAUTHENTICATED', http: { status: 401 }, }, }); } return func(root, args, context, info); }; exports.authenticated = authenticated; //# sourceMappingURL=authenticated-resolver.js.map