Changes to building

This commit is contained in:
KimLS
2019-08-25 14:45:54 -07:00
parent 83cae7aaf3
commit 72a922f2ba
47 changed files with 596 additions and 1812 deletions
-27
View File
@@ -1,27 +0,0 @@
const jwt = require('jsonwebtoken');
var Auth = function (req, res, next) {
var token = '';
try {
token = req.headers.authorization.substring(7);
} catch(ex) {
console.log(ex);
res.sendStatus(401);
return;
}
jwt.verify(token, req.key, function(err, decoded) {
if(err) {
console.log(err);
res.sendStatus(401);
return;
}
req.token = decoded;
next();
});
};
module.exports = {
'auth': Auth
}