mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
first commit on wsl
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user