@krypton-org/krypton-auth
Version:
Express authentication middleware, using GraphQL and JSON Web Tokens.
17 lines (16 loc) • 793 B
TypeScript
/// <reference types="qs" />
/**
* Express middleware to handle {@link module:error/ErrorTypes.OperationalError} in production when not catched by express-graphql.
* @module error/ErrorHandler
*/
import { NextFunction, Request, Response } from 'express';
declare const _default: (err: Error, req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs>, res: Response<any>, next: NextFunction) => void;
/**
* Express middleware rendering {@link module:error/ErrorTypes.OperationalError} error message to client, avoiding server crash for those king of error.
* @param {Error} err
* @param {Request} req
* @param {Response} res
* @param {NextFunction} next
* @renders JSON object containing the error to display.
*/
export default _default;