Added relations to redis ORM
This commit is contained in:
@@ -5,7 +5,7 @@ const {Auth} = require('../controller/auth');
|
||||
async function auth(req, res, next){
|
||||
try{
|
||||
req.token = await Auth.checkToken(req.header('auth-token'));
|
||||
req.user = await req.token.getUser();
|
||||
req.user = req.token.user;
|
||||
return next();
|
||||
}catch(error){
|
||||
next(error);
|
||||
@@ -15,7 +15,7 @@ async function auth(req, res, next){
|
||||
async function authIO(socket, next){
|
||||
try{
|
||||
let token = await Auth.checkToken(socket.handshake.auth.token || 0);
|
||||
socket.user = await token.getUser();
|
||||
socket.user = token.user;
|
||||
next();
|
||||
}catch(error){
|
||||
next(error);
|
||||
|
||||
Reference in New Issue
Block a user