I'm watching a tutorial and I stumbled upon a strange syntax inside a callback func.
(err, user) => {
if (err) {
console.log(err);
res.redirect('/register');
}
passport.authenticate('local')(req, res, () => {
res.redirect('/campgrounds');
});
}
I couldn't describe the syntax to find a good answer on the web, what is happening here? Why are there parentheses next to the auth. function? Is it part of ECS and how is this concept called?
passport.authenticate('local')(req, res, () => {
res.redirect('/campgrounds');
});