From 238657d3560d411b80b470f255e54ea3421ec73e Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Thu, 24 May 2018 16:58:00 +0100 Subject: [PATCH] fix(points): Assign external user points when validated (#17228) Trying to emulate ` component-passport`. There has to be a reason why we don't do this in the user service. --- server/middlewares/jwt-authorization.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/middlewares/jwt-authorization.js b/server/middlewares/jwt-authorization.js index 025bd5c541..7473f0df0c 100644 --- a/server/middlewares/jwt-authorization.js +++ b/server/middlewares/jwt-authorization.js @@ -52,6 +52,7 @@ export default () => function authorizeByJWT(req, res, next) { return User.findById(userId) .then(user => { if (user) { + user.points = user.progressTimestamps.length; req.user = user; } return;