Skip to content

Commit

Permalink
٩(◕‿◕。)۶
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotrajano committed Sep 21, 2020
1 parent 9dc0ca8 commit 185a2d3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions helpers/permissions.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
module.exports = {
isAuthenticated: (req, res, next) => {
return next();
if (req.isAuthenticated()) {
return next();
}
req.flash("error_msg", "User not authenticated!");
res.redirect("/login");
},
isAdmin: (req, res, next) => {
return next();
if (req.isAuthenticated() && req.user.isAdmin === 1) {
return next();
}
Expand Down

0 comments on commit 185a2d3

Please sign in to comment.