0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-01 02:42:23 -05:00

fix: avoid access to sidebar without login (#1794)

This commit is contained in:
Juan Picado 2020-05-01 11:09:44 +02:00 committed by GitHub
parent f9e7f8671b
commit c2e0e1e0bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,7 @@ function addPackageWebApi(route: Router, storage: IStorageHandler, auth: IAuth,
});
});
route.get('/sidebar/(@:scope/)?:package', function(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
route.get('/sidebar/(@:scope/)?:package', can('access'), function(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
const packageName: string = req.params.scope ? addScope(req.params.scope, req.params.package) : req.params.package;
storage.getPackage({