I\'m trying to get my Passport local strategy working.
I\'ve got this middleware set up:
passport.use(new LocalStrategy(function(username, password,
I also had the same problem, could not find any solution on the web but i figured it out.
app.use(require("express-session")({
secret: "This is the secret line",
resave: false,
saveUninitialized: false
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(bodyParser.urlencoded({extended: true}));
express-session requirement and use should be before any other use. Try this i am sure this would work, worked for me!!