Here's the current setup of my route handler in my express app:
app.use('/', function(res, req, next) => {
if (!authorised) next();
f1();
f2();
});
Is there a way to prevent f1() and f2() from running without adding conditional statements like this:
app.use('/', function(res, req, next) => {
if (authorised) {
f1();
f2();
} else {
next();
}
});
Using return next()
can disrupt the proper route handling sequence.