title: Register User Through Passport Js
body: <p>i want to add new user from signup page through help of passport.js 
  Signup form is following</p>
  
  <pre><code>&lt;form id="Signup-form" name="SignupForm" action="/signup" method="post"/&gt;
  &lt;input type="text" id="firstname" name="Firstname" &gt;
  &lt;input type="text" id="lastname" name="Lastname"/&gt;
  &lt;input type="email" name="email" /&gt;
  &lt;input type="text" id="rollno" name="rollno"/&gt;
  &lt;input type="password" name="password" id="password"/&gt;
  &lt;input type="password" name="confirm" id="confirm-password"/&gt;
  &lt;input type="radio" name='Gender' value="Male" /&gt;
  &lt;input type="radio" name='Gender' value="FeMale" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>my passport is initialized in app.js as</p>
  
  <p>required </p>
  
  <pre><code>var passport = require('passport');
  var LocalStrategy = require('passport-local').Strategy;
  </code></pre>
  
  <p>after db setting </p>
  
  <pre><code>require('./config/passport');
  </code></pre>
  
  <p>intialized as</p>
  
  <pre><code>app.use(passport.initialize());
  app.use(passport.session());
  </code></pre>
  
  <p>post sign up route </p>
  
  <pre><code>router.post('/signup', passport.authenticate('local.signup' , {
  successRedirect : '/home',
  failuerRedirect : '/signup',
  failuerFlash: true
  }));
  </code></pre>
  
  <p>my user model </p>
  
  <pre><code>var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  var bcrypt = require('bcrypt-nodejs')
  
  const UserSchema = new Schema({
  First_Name : String,
  Last_Name : String,
  email : String,
  Roll_No : String,
  Gender : String,
  password : String
  },{collection : 'Users'});
  
  UserSchema.methods.encryptPassword = function(password) {
  return bcrypt.hashSync(password, bcrypt.genSaltSync(5), null);
  };
  
  UserSchema.methods.validPassword = function(password) {
  return bcrypt.compareSync(password, this.password);
  }
  var User = mongoose.model('User' , UserSchema); 
  module.exports = User;
  </code></pre>
  
  <p>now my passport.js file in config dir is </p>
  
  <pre><code>var passport = require('passport');
  var User = require('../models/user');
  var LocalStrategy = require('passport-local').Strategy;
  passport.serializeUser(function (user, done) {
  done(null, user.id);
  });
  
  passport.deserializeUser(function (id, done) {
  User.findById(id, function (err, user) {
  done(err, user);
   });
  });
  </code></pre>
  
  <p>my main questions how to write strategy for this route with all fields </p>
  
  <pre><code>passport.use('local.signup', new LocalStrategy({
  //strategy code here
  }));
  </code></pre>