lynx-framework
Version:
lynx is a NodeJS framework for Web Development, based on decorators and the async/await support.
15 lines (14 loc) • 606 B
TypeScript
import { BaseMiddleware } from "../base.middleware";
import * as express from "express";
import App from "../app";
/**
* Default middleware to enable user authentication.
* This middleware supports both session and token authorization.
* The should be injected as the HTTP header "Authorization" and prefixed with "Bearer".
* This middleware retrieve the user from the DB, and adds an user property to the
* standard Express request.
*/
export default class UserAuthMiddleware extends BaseMiddleware {
constructor(app: App);
apply(req: express.Request, _: express.Response): Promise<void>;
}