Restore httpAdminAuth with deprecation warning

This commit is contained in:
Nick O'Leary 2015-02-23 11:39:38 +00:00
parent 5e2c51a741
commit e8666827e6
1 changed files with 8 additions and 7 deletions

15
red.js
View File

@ -121,13 +121,14 @@ settings.flowFile = flowFile || settings.flowFile;
RED.init(server,settings);
//if (settings.httpAdminRoot !== false && settings.httpAdminAuth) {
// app.use(settings.httpAdminRoot,
// express.basicAuth(function(user, pass) {
// return user === settings.httpAdminAuth.user && crypto.createHash('md5').update(pass,'utf8').digest('hex') === settings.httpAdminAuth.pass;
// })
// );
//}
if (settings.httpAdminRoot !== false && settings.httpAdminAuth) {
RED.log.warn("use of httpAdminAuth is deprecated. Use adminAuth instead");
app.use(settings.httpAdminRoot,
express.basicAuth(function(user, pass) {
return user === settings.httpAdminAuth.user && crypto.createHash('md5').update(pass,'utf8').digest('hex') === settings.httpAdminAuth.pass;
})
);
}
if (settings.httpNodeRoot !== false && settings.httpNodeAuth) {
app.use(settings.httpNodeRoot,