I'm not looking for authorization of a particular request and so I did this.If the request path matches I want to skip the auth.verifyToken
middleware.How can I do this.I tried using return next()
but its not working.
eventRouter.param('pin', (req, res, next, pin) => {
let path = `/event/matchpin/${pin}`;
if(req.path === path){
//do something here so that directly executes the route
}
//else it executes the auth.verifyToken middleware
next();
});
app.use('/user',auth.verifyToken,eventRouter);