summaryrefslogtreecommitdiffstats
path: root/server/lib/authentication.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/authentication.js')
-rw-r--r--server/lib/authentication.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/lib/authentication.js b/server/lib/authentication.js
index 0681011..58d5e10 100644
--- a/server/lib/authentication.js
+++ b/server/lib/authentication.js
@@ -102,6 +102,9 @@ module.exports = {
else return next(new Error('TOKEN_INVALID'))
}
req.token = token
+ const decodedToken = jwt.decode(token, { complete: true })
+ req.user = { id: decodedToken.payload.user.id }
+
next()
})
}