Added relations to redis ORM

This commit is contained in:
2024-08-13 15:18:47 -04:00
parent 2a5ca3664a
commit b27e1b1617
20 changed files with 240 additions and 150 deletions
+2 -2
View File
@@ -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);