Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayroid committed Nov 27, 2023
1 parent aaf1902 commit 0c5a7af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middlewares/jwtAuthMW.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ const verifyAccessToken = async (req, res, next) => {
try {
const token = req.headers.authorization;
if (!token) {
return res.sendStatus(403).json({ msg: "User Unauthorized ❌" });
return res.status(403).json({ msg: "User Unauthorized ❌" });
}
jwt.verify(token, process.env.JWT_SECRET, (err, data) => {
if (err) {
console.log("Error Verifying Token ❌");
return res.sendStatus(403).json({ msg: "User Unauthorized ❌" });
return res.status(403).json({ msg: "User Unauthorized ❌" });
}
req.payload = data;
});
} catch (err) {
console.log(err);
return res.sendStatus(403).json({ msg: "User Unauthorized ❌" });
return res.status(403).json({ msg: "User Unauthorized ❌" });
}
next();
};
Expand Down

0 comments on commit 0c5a7af

Please sign in to comment.