O'Reilly logo

Node.js 6.x Blueprints by Fernando Monteiro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the controller's files

Now let's create the controller's files in server/controllers:

  1. Create a file called auth.js and add the following code:
     // get gravatar icon from email var gravatar = require('gravatar'); var passport = require('passport'); // Signin GET exports.signin = function(req, res) { // List all Users and sort by Date res.render('login', { title: 'Login Page', message: req.flash('loginMessage') }); }; // Signup GET exports.signup = function(req, res) { // List all Users and sort by Date res.render('signup', { title: 'Signup Page', message: req.flash('signupMessage') }); }; // Profile GET exports.profile = function(req, res) { // List all Users and sort by Date res.render('profile', { title: 'Profile Page', user : req.user, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required