In the PassportJS Google OAuth Strategy, for some strange reasons, when I serialize the user id and send it to the cookie to be sent to the browser, it does not return the id to deserialize it and that tells me because when I console.log
user, it returns undefined
,
passport.deserializeUser((id, done) => {
User.findById(id).then((user, done) => {
console.log(user);
done(null, user);
});
});
To go into details my cookie is below
app.use(cookieSession({
maxAge: 24 * 60 * 60 * 1000,
keys: 'dkfehfhgddf'
}));