Passport.authenticate not working if it is called as next?

//POST middlewares
app.post(’/login’,(req,res)=>{

if(!Boolean(req.body.box))
req.session.cookie.maxAge=1

},
passport.authenticate(‘local’,{
successRedirect: ‘/home’,
failureRedirect: ‘/login’
})
)