Removing EveryAuth from app.js and from requirements
authorSeth Woodworth <seth@sethish.com>
Sun, 19 Feb 2012 01:13:55 +0000 (20:13 -0500)
committerSeth Woodworth <seth@sethish.com>
Sun, 19 Feb 2012 01:13:55 +0000 (20:13 -0500)
app.js
package.json

diff --git a/app.js b/app.js
index 6b372816851854a7bebbf9d90c42aeaf53805f48..ebe2d0c1c84dd436a418251ea9a10970b5348726 100644 (file)
--- a/app.js
+++ b/app.js
@@ -24,51 +24,6 @@ var Session                  = connect.middleware.session.Session;
 var parseCookie = connect.utils.parseCookie;
 var Backchannel = require('./bc/backchannel');
 
-// ********************************
-// For facebook oauth and connect
-// ********************************
-var everyauth = require('everyauth');
-var FacebookClient = require('facebook-client').FacebookClient;
-var facebook = new FacebookClient();
-
-everyauth.debug = true;
-everyauth.everymodule.logoutPath('/bye');
-
-// configure facebook authentication
-everyauth.facebook
-    .appId('foobieblechreplacethisXXX')
-    .appSecret('foobiederpreplacethisXXX')
-    .myHostname('http://localhost:8000')
-    .scope( 'email')
-    .entryPath('/fbauth')
-    .redirectPath('/schools')
-    .findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetadata, req) {
-        console.log('req.session');
-        console.log(req.session);
-        var userPromise = this.Promise();
-        User.findOne( {'email': fbUserMetadata.email }, function( err, euser ) {
-            console.log("Found a fc user for this fb email");
-            if (err) return userPromise.fail(err);
-            // if a user exists with that email, call them logged in
-            // FIXME: change this to different query on 'fbid'
-            if(euser) {
-                //hsession = new Session( handshake, session );
-                // save thhat this cookie/session-id is right for this user
-                req.session.regenerate( function() {
-                  euser.session = req.sessionID;
-                  euser.save( );
-                  console.log( req.sessionID );
-                  req.user = euser;
-                });
-            }
-            if (euser) return userPromise.fulfill(euser);
-        });
-        return userPromise;
-    });
-    //.callbackPath('/fbsucc')
-
-
-
 
 // Depracated
 // Used for initial testing
@@ -208,9 +163,6 @@ app.configure(function(){
   // Static files are loaded when no dynamic views match.
   app.use( express.static( __dirname + '/public' ) );
 
-  // EveryAuth fb connect
-  app.use( everyauth.middleware() );
-
   // Sets the routers middleware to load after everything set
   // before it, but before static files.
   app.use( app.router );
@@ -1969,8 +1921,6 @@ mongoose.connect( 'mongodb://localhost/fc' ); // FIXME: make relative to hostnam
 
 var mailer = new Mailer( app.set('awsAccessKey'), app.set('awsSecretKey') );
 
-everyauth.helpExpress(app);
-
 app.listen( serverPort, function() {
   console.log( "Express server listening on port %d in %s mode", app.address().port, app.settings.env );
 
index cfe3d42cffa8c294bc4b33dfb43b4cebb0686997..c983aa198c78b78aa2555d48d4cc5c3e719e72da 100644 (file)
@@ -8,7 +8,6 @@
       "connect": "1.8.5",
       "connect-mongo": "0.1.6",
       "ejs": "0.6.1",
-      "everyauth": "0.2.28",
       "express-messages": "0.0.2",
       "express": "2.5.2",
       "facebook-client": "1.5.2",