title: NodeJS passport unknown authentication strategy
body: <p>I am currently working on a node js project with passport authentication.
  But i get the following error message:</p>
  
  <p>Error: "Unknown authentication strategy "</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>LocalStrategy = require('passport-local').Strategy;
  var UserModel = require('../models/user');
  
  module.exports = function(passport){
  passport.serializeUser(function(user, done){
      done(null, user.id);
  });
  passport.deserializeUser(function(id, done) {
      User.findById(id, function(err, user){
          return done(err, user);
      });
  });
  
  passport.use('local-signup', new LocalStrategy({
      passReqToCallback: true
  }, function(req, username, password, done){
      process.nextTick(function(){
          User.findOne({username: username}, function(err, user) {
              if(err){
                  return done(err);
              }
  
              if(user){
                  return done(null, false, req.flash('signUpErr', 'The mail is taken'));
              } else {
                  var newUser = new UserModel();
                  newUser.name = username;
                  newUser.password = newUser.generateHash(password);
  
                  newUser.save(function(err){
                      if(err){
                          throw err;
                      }
                      console.log('All Ok');
                      return done(null, newUser);
                  })
              }
          });
      });
  }));
  </code></pre>
  
  <p>}</p>
  
  <p>Route:</p>
  
  <pre><code>//Post requests
  app.post('/signup', passport.authenticate('local-signup', {
      successRedirect: '/',
      failureRedirect : '/signup'
  }));
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>var mongoose = require('mongoose');
  var bcrypt = require('bcrypt-nodejs');
  
  var UserSchema = new mongoose.Schema({
      name: String,
      password: String
  });
  
  UserSchema.method.generateHash = function(password){
      return bcrypt.hash(password);
  };
  module.exports = mongoose.model('UserModel', UserSchema);
  </code></pre>
  
  <p>I would really need your help, thanks!</p>