From a6fa0432ee0d74049f27f741fe955d102b1ae032 Mon Sep 17 00:00:00 2001 From: Michael Crowe Date: Sun, 4 Sep 2016 13:03:23 -0400 Subject: [PATCH] Prevent the server from crashing if a repo is accessed that the user does not have access to https://github.com/verdaccio/verdaccio/pull/58 https://github.com/verdaccio/verdaccio/issues/56 --- lib/index-web.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/index-web.js b/lib/index-web.js index 2820d1f6e..a62a4005f 100644 --- a/lib/index-web.js +++ b/lib/index-web.js @@ -52,7 +52,11 @@ module.exports = function(config, auth, storage) { async.filterSeries(packages, function(package, cb) { auth.allow_access(package.name, req.remote_user, function(err, allowed) { setImmediate(function () { - cb(err, allowed) + if (err) { + cb(null, false); + } else { + cb(err, allowed) + } }) }) }, function(err, packages) {