August 2016
Intermediate to advanced
376 pages
6h 33m
English
As mentioned earlier, let's create a config file:
server/config, create a file called config.js and place the following code in it: // Database URL
module.exports = {
// Connect with MongoDB on local machine
'url' : 'mongodb://localhost/mvc-app'
};
server/config and name it passport.js. Add the following content: // load passport module var LocalStrategy = require('passport-local').Strategy; // load up the user model var User = require('../models/users'); module.exports = function(passport) { // passport init setup // serialize the user for the session passport.serializeUser(function(user, done) { done(null, user.id); ...Read now
Unlock full access