From 722e7b6107356b09fc353e26d82c349e877c3d2d Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Thu, 12 May 2016 15:33:15 +0100 Subject: [PATCH] authentication --- server/loggerhandler.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/loggerhandler.js b/server/loggerhandler.js index 6b12597..5065840 100644 --- a/server/loggerhandler.js +++ b/server/loggerhandler.js @@ -13,7 +13,6 @@ var router = express.Router(); var EventEmitter = require('events'); -var authentication =require('basic-authentication')(); var authOptions = { hash: 'sha256', // type of hash @@ -21,6 +20,9 @@ var authOptions = { suppress: true // suppress throwing Error if wrong user }; +var authentication =require('basic-authentication')(authOptions); + + var nano = require('nano')('http://martind2000:1V3D4m526i@localhost:5984'); var busEmitter = new EventEmitter(); @@ -52,7 +54,7 @@ var doInsertLog = (obj) =>{ busEmitter.on('saveLog', doInsertLog); -router.get('/', authentication(authOptions), function (req, res) { +router.get('/', authentication, function (req, res) { logger.debug('list..'); dbCouch.view('body','body',function(err, body) {