UNPKG

@caidrive/shared

Version:

caidrive.shared.components

59 lines (58 loc) 975 B
/** * What it does. * * @param name - Parameter description. * @returns Type and description of the returned object. * * @example * ``` * Write me later. * ``` */ import { Request, Response } from "express"; import { NextFunction } from "connect"; /** * */ interface UserInfo { id: string; email: string; roles: string[]; } /** * */ declare global { namespace Express { interface Request { currentUser?: UserInfo; } } } /** * * */ export declare class Middleware { /** * */ private sendJson; /** * */ constructor(); /** * */ requireAuthentication(): (req: Request, res: Response, next: NextFunction) => Promise<void>; /** * */ ensureAuthenticated(): (req: Request, res: Response, next: NextFunction) => void; /** * */ handleErrors(): (error: Error, req: Request, res: Response, next: NextFunction) => void; } export {};