From 3dc3522d0987f0b38f41d08868b04681c40c4efd Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Mon, 18 Mar 2019 17:41:18 +0800 Subject: [PATCH] Delay connect require until authenticate called --- lib/middleware/authenticate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/middleware/authenticate.js b/lib/middleware/authenticate.js index 0357b3a0..8994e5e7 100644 --- a/lib/middleware/authenticate.js +++ b/lib/middleware/authenticate.js @@ -7,7 +7,6 @@ const http = require('http'); const IncomingMessageExt = require('../http/request'); const AuthenticationError = require('../errors/authenticationerror'); -const connect = require('../framework/connect'); /** @@ -98,7 +97,8 @@ module.exports = function authenticate(passport, name, options, callback) { return function authenticate(req, res, next) { if (http.IncomingMessage.prototype.logIn && http.IncomingMessage.prototype.logIn !== IncomingMessageExt.logIn) { - connect.__monkeypatchNode(); + // eslint-disable-next-line + require('../framework/connect').__monkeypatchNode(); }