first commit on wsl

This commit is contained in:
canove
2020-06-24 13:42:45 -03:00
parent c60c0f44fc
commit 1bc4831f8f
6 changed files with 14028 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ module.exports = (req, res, next) => {
try {
const [, token] = req.get("Authorization").split(" ");
decodedToken = jwt.verify(token, "mysecret");
// todo >> find user in DB and store in req.user to use latter, or throw an error if user not exists anymore
req.userId = decodedToken.userId;
} catch (err) {
err.statusCode = 401;