-
-
Save newz2000/a73a493839a7de58e350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contacts = require('./routes/contacts'); | |
var passport = require('passport'); | |
// passport configured and working | |
// ... | |
app.use('/contacts/', contacts); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passport = require('passport'); | |
var express = require('express'); | |
var router = express.Router(); | |
var Account = require('../models/account'); | |
var Contact = require('../models/contact'); | |
router.use(passport.authenticate('local', { failure: '/auth/login' })); | |
router.get('/', function(req, res) { | |
Contact.find( function(err, contacts, count) { | |
res.render('list', {contacts: contacts}); | |
}); | |
}); | |
// router.get('/', passport.authenticate('local'), function(req, res) { | |
// Contact.find( function(err, contacts, count) { | |
// res.render('list', {contacts: contacts}); | |
// }); | |
// }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment