mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Merge pull request #4572 from kevinGodell/dev
let settings.httpNodeAuth accept single middleware or array of middlewares
This commit is contained in:
		
							
								
								
									
										8
									
								
								packages/node_modules/node-red/red.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								packages/node_modules/node-red/red.js
									
									
									
									
										vendored
									
									
								
							| @@ -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); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user