I am using passport-local
, passport-jwt
module for authentication strategy in my application. I am trying to understand would I still need to use passport.serialize()
and passport.deserialize()
methods. As far as I understand these methods uses sessions to store user info. I suspect that purpose of using these methods is already fulfilled using JwtStrategy
. Or I am completely wrong here ?
I tried looking over web but couldn't get much information there.
Here is my code for the JWT strategy
router.get('/current', passport.authenticate('jwt', {session: false}), (req, res) => {
res.json({
id: req.user.id,
email: req.user.email,
first_name: req.user.first_name,
last_name: req.user.last_name,
});
})
Please correct me if I am wrong about my assumption.