UNPKG

@pothos/plugin-scope-auth

Version:

A Pothos plugin for adding scope based authorization checks to your GraphQL Schema

30 lines (29 loc) 919 B
function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } import { PothosValidationError } from '@pothos/core'; import { AuthScopeFailureType } from './types.js'; export class ForbiddenError extends PothosValidationError { constructor(message, result) { super(message), _define_property(this, "code", "FORBIDDEN"), _define_property(this, "result", void 0); this.name = "ForbiddenError"; this.result = result !== null && result !== void 0 ? result : { kind: AuthScopeFailureType.Unknown }; Object.defineProperty(this, "name", { value: "ForbiddenError" }); } } //# sourceMappingURL=errors.js.map