I have the passport.js authentication and it accepts correct credentials and not incorrect. 

I am trying to make a pop up message appear appear for incorrect credentials.

tried numerous attempts and by following the documentation but cannot get it to work.
There doesnt seem to be too much in it but cant get it quite right.

Setting up strategy

```
var flash = require('connect-flash');

var app = express();
app.use(flash());

passport.use(new Strategy(
  function(username, password, cb) {
    db.users.findByUsername(username, function(err, user) {
      if (err) { return cb(err); }
      if (!user) { return cb(null, false, { message: 'Incorrect password.' } ); }
      if (user.password != password) { return cb(null, false, { message: 'Incorrect password.' }); }
      return cb(null, user);
    });
  }));

```

Authentication - Post and Get

```
//Log In Post request
app.post('/login.post',
  passport.authenticate('local', { successRedirect: '/home',
                                   failureRedirect: '/',
                                   failureFlash: 'Invalid log in, please try again' })
);

//Home route
app.get('/home', //Log in Home
  function(req, res) {
   res.render('home', { user: req.user });
 });

```