79620580

Date: 2025-05-14 00:42:30
Score: 0.5
Natty:
Report link

I found the answer to this problem. If someone else encounters this problem I was having an issue with a mismatch in my serialize and deserialize functions for passport.js. In my final setup I ended up implementing postgres so this is what my final setup looked like:

passport.serializeUser((user, done) => {
  // Storing just the user.id here
  done(null, user.id);
});

passport.deserializeUser((id, done) => {
   return done(null, id);
});

The important parts are what you pass in to each of the functions. Since I am "exporting" id from serialize it is important that I "import" id in deserialize, as well as "export" it from deserialize (at least for my setup)

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Arthur