Revert "Build System Updated"

This commit is contained in:
Alex
2019-10-12 21:07:06 -07:00
committed by GitHub
parent 579471afcc
commit b9f57f1f28
193 changed files with 14124 additions and 10507 deletions
+27
View File
@@ -0,0 +1,27 @@
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
}