authentication error with passport-local and passport-local-mongoose authentication error with passport-local and passport-local-mongoose mongoose mongoose

authentication error with passport-local and passport-local-mongoose


Let's check the stack trace to see if we can find a hint:

TypeError: user.get is not a function    at /home/ubuntu/workspace/attendance/v4/node_modules/passport-local-mongoose/index.js:217:21    at pass (/home/ubuntu/workspace/attendance/v4/node_modules/passport/lib/authenticator.js:347:9)    at Authenticator.deserializeUser (/home/ubuntu/workspace/attendance/v4/node_modules/passport/lib/authenticator.js:352:5)    ...

Hmm, deserializeUser might be causing the problem.

Let's look at how it's set up:

passport.serializeUser(student.serializeUser());passport.deserializeUser(student.serializeUser());

Perhaps you meant to pass student.deserializeUser() to passport.deserializerUser()?