Move over to settings.adminAuth

This commit is contained in:
Nick O'Leary
2014-11-12 20:58:48 +00:00
parent 74e1ef0823
commit f3eb85c449
6 changed files with 7 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ var server = oauth2orize.createServer();
server.exchange(oauth2orize.exchange.password(strategies.passwordTokenExchange));
function authenticate(req,res,next) {
if (settings.httpAdminAuth) {
if (settings.adminAuth) {
if (/^\/auth\/.*/.test(req.originalUrl)) {
next();
} else {

View File

@@ -22,9 +22,9 @@ var settings = require("../../settings");
//{username:"nick",password:crypto.createHash('md5').update("foo",'utf8').digest('hex')}
var users = [];
if (settings.httpAdminAuth) {
if (settings.httpAdminAuth.user && settings.httpAdminAuth.pass) {
users.push({username:settings.httpAdminAuth.user, password:settings.httpAdminAuth.pass});
if (settings.adminAuth) {
if (settings.adminAuth.user && settings.adminAuth.pass) {
users.push({username:settings.adminAuth.user, password:settings.adminAuth.pass});
}
}