I am creating a dynamic middleware where middleware contains middleware function name. but it is generating the error as in title.
if (to.meta.middleware){
const middleware = Array.isArray(to.meta.middleware)?to.meta.middleware:[to.meta.middleware]
const context = {
from,
next,
router,
to
}
const nextMiddleware = nextFactory(context, middleware, 1);
return middleware[0]({context, next:nextMiddleware});
}
return next();
})```
Aucun commentaire:
Enregistrer un commentaire