From 6588bb294fceb091190d03fd4c9bf5b75c68fc64 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Wed, 24 Apr 2013 10:09:30 +0200 Subject: adding facebooksupport --- package.json | 1 + router.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 793d239..e218182 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "less-middleware": "*", "passport": "*", "passport-local": "*", + "passport-facebook": "*", "bcrypt": "*" } } diff --git a/router.js b/router.js index 5a7f67c..7fcf230 100644 --- a/router.js +++ b/router.js @@ -1,10 +1,13 @@ var passport = require('passport') , LocalStrategy = require('passport-local').Strategy + , FacebookStrategy = require('passport-facebook').Strategy , mongodb = require('mongodb') , mongoose = require('mongoose') , bcrypt = require('bcrypt') , SALT_WORK_FACTOR = 15; +var FACEBOOK_APP_ID = "504825706245603"; +var FACEBOOK_APP_SECRET = "e5ea0faed85d8749cafd38732530ef35"; // connects to mongodb mongoose.connect('localhost', 'test'); @@ -190,8 +193,9 @@ module.exports = function(app) { * '/dashboard' */ - app.get('/dashboard', function(req, res) { - res.render('dashboard', { + app.get('/dashboard', ensureAuthenticated, function(req, res) { + console.log(req.user.username); + res.render('dashboard', { title: 'kanin', loggedin: true }); -- cgit v1.2.3