title: Passport.js local strategy WITHOUT mongoose
body: <p>I'm trying to find resources about the most simple login with passport for a node app. I mean, using:</p>
  
  <p>middleware:</p>
  
  <pre><code>    app.use(bodyParser.json());
      app.use(bodyParser.urlencoded({extended: false}));
      app.use(cookieParser());
  
      app.use(session({ secret: 'keyboard cat', resave: false, saveUninitialized: false }));
      app.use(passport.initialize());
      app.use(passport.session());
  
      app.use(express.static('public'));
  </code></pre>
  
  <p>passport:</p>
  
  <pre><code>passport.serializeUser(function(user, done) {
      done(null, user.id);
  });
  
  passport.deserializeUser(function(id, done) {
      done({ id: id, nickname: "test"})
  });
  
  
      passport.use(new LocalStrategy(
        function(username, password, done) {
          console.log("test");
            if (username === 'username') {
                return done(null, { name: "test", id: '1234'});
            } else {
                return done(null, false, { message: 'Incorrect cred.' });
            }
        })
      )
  </code></pre>
  
  <p>and redirection:</p>
  
  <pre><code>    app.post('/login',
        passport.authenticate('local', { 
            successRedirect: '/index.html',
            failureRedirect: '/login'
       })
      );
  </code></pre>
  
  <p>my app structure:</p>
  
  <pre><code>/app.js
  /public/index.html
  /public/login.html
  </code></pre>
  
  <p>And that's it. the Web is full of the same examples of Mongoose with plugins, everyone simply copy-pasting from each other. </p>
  
  <p>The point is that I would like, later on, to insert my own code ti the LocalStrategy code (would probably used LDAP).</p>
  
  <p>Currently, instead of redirecting to /index.html with the page created in the public folder, I just receive <code>[object Object]</code> on index.html.</p>