diff --git a/public/templates/admin/facebook.tpl b/public/templates/admin/facebook.tpl
deleted file mode 100644
index 19137f8500..0000000000
--- a/public/templates/admin/facebook.tpl
+++ /dev/null
@@ -1,23 +0,0 @@
-
Facebook Social Authentication
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/public/templates/admin/header.tpl b/public/templates/admin/header.tpl
index 2baa221059..5a2b08c0c1 100644
--- a/public/templates/admin/header.tpl
+++ b/public/templates/admin/header.tpl
@@ -116,7 +116,6 @@
- Twitter
- - Facebook
- Google+
-
diff --git a/public/templates/config.json b/public/templates/config.json
index f2ce55afa8..81b6435a9b 100644
--- a/public/templates/config.json
+++ b/public/templates/config.json
@@ -12,7 +12,6 @@
"^admin/languages/?$": "admin/languages",
"^admin/settings.*": "admin/settings",
"^admin/twitter.*": "admin/twitter",
- "^admin/facebook.*": "admin/facebook",
"^admin/logger.*": "admin/logger",
"^admin/gplus.*": "admin/gplus",
"^admin/motd/?$": "admin/motd",
diff --git a/src/login.js b/src/login.js
index 50ce805b21..29fea1391b 100644
--- a/src/login.js
+++ b/src/login.js
@@ -138,47 +138,4 @@ var user = require('./user'),
});
};
- Login.loginViaFacebook = function(fbid, name, email, callback) {
- user.getUidByFbid(fbid, function(err, uid) {
- if(err) {
- return callback(err);
- }
-
- if (uid !== null) {
- // Existing User
- callback(null, {
- uid: uid
- });
- } else {
- // New User
- var success = function(uid) {
- // Save facebook-specific information to the user
- user.setUserField(uid, 'fbid', fbid);
- db.setObjectField('fbid:uid', fbid, uid);
- callback(null, {
- uid: uid
- });
- };
-
- user.getUidByEmail(email, function(err, uid) {
- if(err) {
- return callback(err);
- }
-
- if (!uid) {
- user.create({username: name, email: email}, function(err, uid) {
- if(err) {
- return callback(err);
- }
-
- success(uid);
- });
- } else {
- success(uid); // Existing account -- merge
- }
- });
- }
- });
- }
-
}(exports));
diff --git a/src/routes/admin.js b/src/routes/admin.js
index 0cdac99a9a..3977a659e1 100644
--- a/src/routes/admin.js
+++ b/src/routes/admin.js
@@ -58,7 +58,7 @@ var nconf = require('nconf'),
(function () {
var routes = [
'categories/active', 'categories/disabled', 'users', 'topics', 'settings', 'themes',
- 'twitter', 'facebook', 'gplus', 'database', 'events', 'motd', 'groups', 'plugins',
+ 'twitter', 'gplus', 'database', 'events', 'motd', 'groups', 'plugins',
'languages', 'logger',
'users/latest', 'users/sort-posts', 'users/sort-reputation', 'users/search'
];
@@ -413,10 +413,6 @@ var nconf = require('nconf'),
res.json(200, {});
});
- app.get('/facebook', function (req, res) {
- res.json(200, {});
- });
-
app.get('/gplus', function (req, res) {
res.json(200, {});
});
diff --git a/src/routes/authentication.js b/src/routes/authentication.js
index 8b1bc8b4af..b8007de36a 100644
--- a/src/routes/authentication.js
+++ b/src/routes/authentication.js
@@ -3,7 +3,6 @@
passportLocal = require('passport-local').Strategy,
passportTwitter = require('passport-twitter').Strategy,
passportGoogle = require('passport-google-oauth').OAuth2Strategy,
- passportFacebook = require('passport-facebook').Strategy,
login_strategies = [],
nconf = require('nconf'),
meta = require('../meta'),
@@ -78,29 +77,6 @@
});
}
- if (meta.config['social:facebook:app_id'] && meta.config['social:facebook:secret']) {
- passport.use(new passportFacebook({
- clientID: meta.config['social:facebook:app_id'],
- clientSecret: meta.config['social:facebook:secret'],
- callbackURL: nconf.get('url') + '/auth/facebook/callback'
- }, function(accessToken, refreshToken, profile, done) {
- login_module.loginViaFacebook(profile.id, profile.displayName, profile.emails[0].value, function(err, user) {
- if (err) {
- return done(err);
- }
- done(null, user);
- });
- }));
-
- login_strategies.push({
- name: 'facebook',
- url: '/auth/facebook',
- callbackURL: '/auth/facebook/callback',
- icon: 'facebook',
- scope: 'email'
- });
- }
-
passport.serializeUser(function(user, done) {
done(null, user.uid);
});
diff --git a/src/user.js b/src/user.js
index 4728f4b824..405d533cc4 100644
--- a/src/user.js
+++ b/src/user.js
@@ -760,15 +760,6 @@ var bcrypt = require('bcrypt'),
});
};
- User.getUidByFbid = function(fbid, callback) {
- db.getObjectField('fbid:uid', fbid, function(err, uid) {
- if (err) {
- return callback(err);
- }
- callback(null, uid);
- });
- };
-
User.isModerator = function(uid, cid, callback) {
db.isSetMember('cid:' + cid + ':moderators', uid, function(err, exists) {
if(err) {