From 3871e7c0ecf50b8756201ce5945cde4e77005601 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Sat, 7 Dec 2013 01:05:19 -0500 Subject: [PATCH] Inline tumblr callback instead of placing it in passportConfig --- app.js | 4 ++-- config/passport.js | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index 52c11bd425..dcac484be1 100755 --- a/app.js +++ b/app.js @@ -73,7 +73,7 @@ app.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' })) app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' })); app.get('/auth/github', passport.authenticate('github')); -app.get('/auth/github/callback', passport.authenticate('github', { failureRedirect: '/login' }), function(req, res) { res.redirect('/'); }); +app.get('/auth/github/callback', passport.authenticate('github', { successRedirect: '/', failureRedirect: '/login' })); app.get('/auth/google', passport.authenticate('google', { scope: 'profile email' })); app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' })); @@ -85,7 +85,7 @@ app.get('/auth/foursquare', api.foursquareAuth); app.get('/auth/foursquare/callback', api.foursquareCallback); app.get('/auth/tumblr', passport.authorize('tumblr')); -app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), passportConf.tumblrCallback); +app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), function(req, res) { res.redirect('/api/tumblr'); }); app.listen(app.get('port'), function() { console.log('Express server listening on port ' + app.get('port')); diff --git a/config/passport.js b/config/passport.js index 1b86659e06..a5f979a727 100755 --- a/config/passport.js +++ b/config/passport.js @@ -125,9 +125,4 @@ exports.ensureAdmin = function ensureAdmin(req, res, next) { else res.send(403); }; -}; - - -exports.tumblrCallback = function(req, res) { - res.redirect('/api/tumblr'); -}; +}; \ No newline at end of file