diff --git a/lib/app.js b/lib/app.js index c367bd7a..36dbdecb 100755 --- a/lib/app.js +++ b/lib/app.js @@ -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(); }); };