mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-04 02:02:39 -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:
parent
6fb1dc2342
commit
a6fa0432ee
1 changed files with 5 additions and 1 deletions
|
@ -52,7 +52,11 @@ module.exports = function(config, auth, storage) {
|
||||||
async.filterSeries(packages, function(package, cb) {
|
async.filterSeries(packages, function(package, cb) {
|
||||||
auth.allow_access(package.name, req.remote_user, function(err, allowed) {
|
auth.allow_access(package.name, req.remote_user, function(err, allowed) {
|
||||||
setImmediate(function () {
|
setImmediate(function () {
|
||||||
|
if (err) {
|
||||||
|
cb(null, false);
|
||||||
|
} else {
|
||||||
cb(err, allowed)
|
cb(err, allowed)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}, function(err, packages) {
|
}, function(err, packages) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue