0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-27 22:59:51 -05:00

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
This commit is contained in:
Michael Crowe 2016-09-04 13:03:23 -04:00 committed by trent.earl
parent 6fb1dc2342
commit a6fa0432ee

View file

@ -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) {