diff --git a/packages/node_modules/node-red/red.js b/packages/node_modules/node-red/red.js index 85b5aec48..35ec090c9 100755 --- a/packages/node_modules/node-red/red.js +++ b/packages/node_modules/node-red/red.js @@ -415,9 +415,15 @@ httpsPromise.then(function(startupHttps) { if (settings.httpAdminRoot !== false) { app.use(settings.httpAdminRoot,RED.httpAdmin); } + if (settings.httpNodeRoot !== false && settings.httpNodeAuth) { - app.use(settings.httpNodeRoot,basicAuthMiddleware(settings.httpNodeAuth.user,settings.httpNodeAuth.pass)); + if (typeof settings.httpNodeAuth === "function" || Array.isArray(settings.httpNodeAuth)) { + app.use(settings.httpNodeRoot, settings.httpNodeAuth); + } else { + app.use(settings.httpNodeRoot, basicAuthMiddleware(settings.httpNodeAuth.user, settings.httpNodeAuth.pass)); + } } + if (settings.httpNodeRoot !== false) { app.use(settings.httpNodeRoot,RED.httpNode); }