MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / isAdmin

Function isAdmin

backend/util.js:36–42  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

34};
35
36const isAdmin = (req, res, next) => {
37 console.log(req.user);
38 if (req.user && req.user.isAdmin) {
39 return next();
40 }
41 return res.status(401).send({ message: 'Admin Token is not valid.' });
42};
43
44export { getToken, isAuth, isAdmin };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected