mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Merge remote-tracking branch 'upstream/master' into merge_7_25
This commit is contained in:
@@ -4,12 +4,19 @@ import * as express from 'express';
|
||||
|
||||
var app = express();
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
export interface Request {
|
||||
user?: any
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (!req.user) return next(createError(401, 'Please login to view this page.'));
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
/* Examples taken from https://github.com/jshttp/http-errors/blob/1.3.1/test/test.js */
|
||||
|
||||
// createError(status)
|
||||
|
||||
Reference in New Issue
Block a user