var passport      = require('passport')
  , bcrypt        = require('bcryptjs')
  , LocalStrategy = require('passport-local').Strategy
  , users         = require('../controllers/user-controller')
  , db            = require('../../../models');

passport.serializeUser(function(user, done) {
  done(null, user);
});

passport.deserializeUser(function(user, done) {
  done(null, user);
});

passport.use('signin', new LocalStrategy(
    {
        usernameField     : 'EMAIL'
      , passwordField     : 'PASSWORD'
      , passReqToCallback : true
    },
    function(request, username, password, done){

        users.findByEmail(request)
        .then(function(user){

            bcrypt.compare(password, user.PASSWORD, function(err, res){
                if(err || !res)
                    return done(null, false, { message: 'Email or Password Invalid'});
                else
                    return done(null, user);
            });
        })
        .catch(function(err){
            done(err);
        });
    }
));

@@ -873,16 +873,169 @@
     else
+ %7B%0A                    if(user.USER_STATUS == 1)%0A                        return done(null, false, %7B message : 'Verify your account, check your email' %7D)%0A
 %0A       
@@ -1068,24 +1068,42 @@
 ull, user);%0A
+                %7D%0A
             

check if user is verified