Attach device object from isAuthorized to request
This commit is contained in:
parent
d80758e834
commit
e5b94527a9
1 changed files with 3 additions and 2 deletions
|
|
@ -55,9 +55,10 @@ config.load(function(err, conf) {
|
|||
var e = new Error('Unauthorized');
|
||||
e.status = 401;
|
||||
|
||||
config.isAuthorized(fingerprint, function (err, authorized) {
|
||||
config.isAuthorized(fingerprint, function (err, device) {
|
||||
if (err) { return next(e); }
|
||||
if (!authorized) { return next(e); }
|
||||
if (!device) { return next(e); }
|
||||
req.device = device;
|
||||
next();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue