I am trying to implement Login functionality on my website with passport. If I use passport.authenticate() to log in, when I actually try logging from my website it remains stuck loading forever (although without crashing the website).
router.get('/login', (req,res)=>{
res.render('users/login');
})
router.post('/login',passport.authenticate('local', {successRedirect:"/campgrounds", successFlash:'Welcome', failureRedirect:'/login', failureFlash: 'Invalid Credentials' }));