Hey guys I got problem with calling function after passport authorized the user, in the documentation it says app.get('/api/users/me', passport.authenticate('basic', { session: false }), function(req, res) { res.json({ id: req.user.id, username: req.user.username }); });I'm doing the same thing and my code is : ``` exports.loginCheck = passport.authenticate('local-login', { successRedirect: '/', failureRedirect: '/login', failureFlash: true }), function(req, res){ if(req.body.rememberme){ req.session.cookie.maxAge = 1000 * 60 * 60 * 24 * 10; //Session for 10 days } else{ req.session.cookie.expires = false; } console.log("hi") }But the the function(req,res) ``` doesn't work. Any idea?
Submitted February 18, 2020 at 12:33PM by amirrezagh75
No comments:
Post a Comment