express-masquerade
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -8,3 +8,3 @@ module.exports = function(getUser, options) { | ||
if (typeof options.authorize === 'function' && !options.authorize(req, res, next)) return next(); | ||
if (typeof options.authorize === 'function' && !options.authorize(req)) return next(); | ||
@@ -11,0 +11,0 @@ var id = req.get(options.header); |
{ | ||
"name": "express-masquerade", | ||
"description": "masquerade as other users", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"contributors": [ | ||
@@ -9,3 +9,3 @@ "Chris Roth <chris@cjroth.com>" | ||
"license": "MIT", | ||
"repository": "cjroth.com/express-masquerade", | ||
"repository": "cjroth/express-masquerade", | ||
"keywords": [ | ||
@@ -12,0 +12,0 @@ "express", |
@@ -15,7 +15,9 @@ # express-masquerade | ||
```js | ||
var express = require('express'); | ||
var masquerade = require('express-masquerade'); | ||
var app = express(); | ||
app.use(require('express-masquerade')(function(id, done) { | ||
User | ||
.find(id) | ||
.complete(done); | ||
app.use(masquerade(function(id, next) { | ||
User.find(id).complete(next); | ||
})); | ||
@@ -56,3 +58,3 @@ ``` | ||
var options = { | ||
authorize = function(req, res, next) { | ||
authorize: function(req) { | ||
return req.user.role === 'admin'; | ||
@@ -59,0 +61,0 @@ } |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3253
62