(req, res, next)
| 30 | }) |
| 31 | |
| 32 | const 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 | |
| 41 | export { |
| 42 | protect, |
nothing calls this directly
no outgoing calls
no test coverage detected