🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

express-access-control

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-access-control - npm Package Compare versions

Comparing version

to
2.0.0

README.md~

5

lib/ExpressAccessControl.js

@@ -70,3 +70,6 @@ //Copyright (c) 2015 Eric Vallee <eric_vallee2003@yahoo.ca>

{
Res.status(401).end();
var Err = new Error();
Err.Source = "ExpressAccessControl";
Err.Type = "NoAccess";
Next(Err);
}

@@ -73,0 +76,0 @@ });

2

package.json
{
"name": "express-access-control",
"version": "1.0.0",
"version": "2.0.0",
"description": "Middleware to perform access control based on the user's session and groups.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -69,3 +69,3 @@ Express-Access-Control

If the user doesn't pass authentication, the 401 code is returned as a response, else Next() is called to go to the next route handler.
If the user doesn't pass authentication, then Next(Err) is called, where Err is an error with Err.Source set to "ExpressAccessControl" and Err.Type set to "NoAccess". If the user passes authentication, then Next() is called to go to the next route handler.

@@ -160,3 +160,6 @@ &lt;Options&gt; can take 2 formats:

2.0.0
-----
The library's 'AuthenticateRoute' method will now deleguate the response to an error handler if the user doesn't pass authentication.

@@ -163,0 +166,0 @@

@@ -16,2 +16,12 @@ //Copyright (c) 2015 Eric Vallee <eric_vallee2003@yahoo.ca>

});
App.use('/', function(Err, Req, Res, Next) {
if(Err.Source && Err.Source === 'ExpressAccessControl')
{
Res.status(401).end();
}
else
{
Next(Err);
}
});
Context['Server'] = Http.createServer(Context['App']);

@@ -18,0 +28,0 @@ Context['Server'].listen(8080, function() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet