Skip to content

Commit

Permalink
Fixed JWT typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshit Pal committed Mar 24, 2020
1 parent 356f404 commit 87bcfb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const decode = header => {
if (type !== "Bearer" || !token) {
return false;
}
return jwt.verify(token, "secretKey");
try {
return jwt.verify(token, process.env.SECRET);
} catch {
return false;
}
};

router.get("/favourites", (req, res, next) => {
Expand Down

0 comments on commit 87bcfb4

Please sign in to comment.