Open Sakthilab opened 2 years ago
I had this the same problem with app.post("/submit). It turned out to be an error with my submittedSecret constant.
I had => const submittedSecret = req.body.submit; when I should've had => const submittedSecret = req.body.secret;
This may (or may not) be the same issue you're getting.
Another cause for the problem would be returning the user id during serialization:
passport.serializeUser(function(user, cb) { process.nextTick(function() { return cb(null, { id: user.id, username: user.username }); }); });
Read More Here => https://www.passportjs.org/concepts/authentication/sessions/
when i try to click submit the secret it is not getting the user id
when i checked using console.log(req.user.id) it is showing "undefined"
facing isse with app.post("/submit")
just use console.log(req.user) you will get the id of the user.....
and copy the sessions from the link given below:-
https://www.passportjs.org/concepts/authentication/downloads/html/
when i try to click submit the secret it is not getting the user id
when i checked using console.log(req.user.id) it is showing "undefined"
facing isse with app.post("/submit")