Inline tumblr callback instead of placing it in passportConfig

This commit is contained in:
Sahat Yalkabov
2013-12-07 01:05:19 -05:00
parent 435b006967
commit 3871e7c0ec
2 changed files with 3 additions and 8 deletions

4
app.js
View File

@ -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/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' }));
app.get('/auth/github', passport.authenticate('github')); 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', passport.authenticate('google', { scope: 'profile email' }));
app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' })); 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/foursquare/callback', api.foursquareCallback);
app.get('/auth/tumblr', passport.authorize('tumblr')); 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() { app.listen(app.get('port'), function() {
console.log('Express server listening on port ' + app.get('port')); console.log('Express server listening on port ' + app.get('port'));

View File

@ -126,8 +126,3 @@ exports.ensureAdmin = function ensureAdmin(req, res, next) {
res.send(403); res.send(403);
}; };
}; };
exports.tumblrCallback = function(req, res) {
res.redirect('/api/tumblr');
};