title: How Should i get validation errors with sequelize and passport on login
body: <p>i'm already set validate in User Model.
  My Route Code is like this where I'm trying for validate.</p>
  
  <pre><code>var express = require('express');
  var loginRouter = express.Router();
  var passport = require('passport');
  var User = require('../app/models/model')().User;
  
  module.exports = function() {
  
      var loginController = require('../controller/loginController')();
  
      loginRouter.get('/login',loginController.getLogin);
      loginRouter.post('/login',
          function (req, res, next) {
  
              User.validate().success(function () {
                next(); // only call next if validation passes
              }).error(function (error) {
                  console.log(error);
                res.redirect('/auth/login');
                // or res.send({error: true}) or res.redner( ... )
              })
  
          },
          passport.authenticate('local-login',{   
                  successRedirect: '/dashboard',
                  failureRedirect: '/auth/login',
                  failureFlash : true
              }
          ));
  
      return loginRouter;
  </code></pre>
  
  <h2>    };</h2>
  
  <p>User.js</p>
  
  <pre><code>var Sequelize = require('sequelize');
  
  var attributes = {
      username:
      {
          type: Sequelize.STRING,
          field: 'username',
          validate: {
              notNull: true,
          }
      },
      password:
      {
          type: Sequelize.STRING,
          field: 'password',
          validate: {
              notNull: true,
          }
      }
  }
  
  var options = {
      freezeTableName: true,
      timestamps: false
  }
  
  module.exports.attributes = attributes;
  module.exports.options = options;
  </code></pre>
  
  <p>model.js</p>
  
  <pre><code>var Sequelize = require('sequelize')
      config = require('../../config/config').database;
  
  module.exports = function(){
  
      var sequelize = new Sequelize(config.database,config.username,config.password,config.options);
  
      var UserMeta = require('./User');
      var User = sequelize.define('users',UserMeta.attributes,UserMeta.options);
  
      return {
          User: User
      }
  };
  </code></pre>
  
  <hr>
  
  <p>so i don't know what i'm doing wrong here or which thing i forgot.
  so any idea about it?</p>