From bb397c8ca05a91cf5e2d5fd74df077cba36ab640 Mon Sep 17 00:00:00 2001 From: Josepablo C Date: Wed, 20 Mar 2024 21:03:40 -0600 Subject: [PATCH] EN-99 fix, return company in user data on GET profile --- src/apps/private/lib/context/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/private/lib/context/index.js b/src/apps/private/lib/context/index.js index f23e23c..b6800ec 100644 --- a/src/apps/private/lib/context/index.js +++ b/src/apps/private/lib/context/index.js @@ -9,7 +9,7 @@ async function middleware( req, res, next ){ } const userID = req.JWT.payload.sub; req.context = { - user : await usersModel.findById( userID , { password : 0 , session_token : 0 , session_token_exp : 0 } ) + user : await usersModel.findById( userID , { password : 0 , session_token : 0 , session_token_exp : 0 } ).populate('company') } req.context.userId = req.context.user.id; req.context.companyId = req.context.user.company || null;