Inline tumblr callback instead of placing it in passportConfig
This commit is contained in:
4
app.js
4
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/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'));
|
||||||
|
@ -125,9 +125,4 @@ exports.ensureAdmin = function ensureAdmin(req, res, next) {
|
|||||||
else
|
else
|
||||||
res.send(403);
|
res.send(403);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
exports.tumblrCallback = function(req, res) {
|
|
||||||
res.redirect('/api/tumblr');
|
|
||||||
};
|
|
Reference in New Issue
Block a user