aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-04-24 10:09:30 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-04-24 10:09:30 +0200
commit6588bb294fceb091190d03fd4c9bf5b75c68fc64 (patch)
treea522fa846be2214fdb982c8b87ba23213223b14d
parentremoved authenticationcheck on dashboard (diff)
downloadDivid-6588bb294fceb091190d03fd4c9bf5b75c68fc64.tar.gz
adding facebooksupport
-rw-r--r--package.json1
-rw-r--r--router.js8
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
});