routes/index.js
//call quest response() to test whether or not the user is authenticated
call quest response() to test whether or not the user is authenticated
call quest response () to test whether or not the user is authenticated
function authenticationMiddleware() {  
	return (req, res, next) => {
		console.log(`req.session.passport.user: ${JSON.stringify(req.session.passport)}`);
	    if (req.isAuthenticated()) return next();
	    res.redirect('/login');
	}
}
function authenticationMiddleware ( ) { return ( req , res , next ) => { console . log ( ` ${ JSON . stringify ( req . session . passport ) } ` ) ; if ( req . isAuthenticated ( ) ) return next ( ) ; res . redirect ( '/login' ) ; } }
call quest response() to test whether or not the user is authenticated
call quest response () to test whether or not the user is authenticated
//only if the user is authenticated  //if use is NOT authenticated then redirect them to login page