I have problem with creating node.js application based on express with http-auth module.
It's a possible create Middleware for this http-auth library I have this code:
//Configure Middlewares
logger.configure(function() {
//All output has content type json
logger.use(function(req, res, next) {
res.contentType('application/json');
next();
});
//Create digest auth middleware
logger.use(function(req, res, next){
digest.apply();
next();
});
});
After applying this, when I connect to site I get this error:
TypeError: Cannot read property 'headers' of undefined
Is there any solution for this problem or use another method?
I need digest auth for the whole application.