I have a system to do with express.js, but I had difficulty. I want to do something like this.
Middleware;
module.exports = {
AuthorityCheck: function(req, res, next) {
//console.log(/*Where I get the roles*/)
//
}
}
Routes;
routes.get('/admin', AuthorityCheck['role','role2'], (req, res, next) => {
res.render('admin/index.html')
})
How do I get the roles given in AuthorityCheck? Please help me.