MCPcopy Create free account
hub / github.com/SanjulaD/web-cw / admin

Function admin

backend/middleware/authMiddleware.js:32–39  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

30})
31
32const admin = (req, res, next) => {
33 if(req.user && req.user.isAdmin) {
34 next()
35 } else {
36 res.status(401)
37 throw new Error('Not authorized as an admin')
38 }
39}
40
41export {
42 protect,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected