This commit is contained in:
2020-05-05 23:07:00 -04:00
parent f2309463a4
commit 4d51a4ac9e
26 changed files with 476 additions and 189 deletions

View File

@ -5,7 +5,8 @@ const {Auth} = require('../models/auth');
async function auth(req, res, next){
try{
let user = await Auth.checkToken({token: req.header('auth-token')});
if(user.username){
if(user.uid){
req.user = user;
return next();
}