Simplified google oauth route

This commit is contained in:
Sahat Yalkabov
2013-11-26 23:22:07 -05:00
parent c37a4d7ba8
commit 73af28d014

23
app.js
View File

@ -45,33 +45,26 @@ app.get('/', home.index);
app.get('/login', user.getLogin);
app.post('/login', user.postLogin);
app.get('/logout', user.logout);
app.get('/signup', user.getSignup);
app.post('/signup', user.postSignup);
app.get('/account', passportConf.ensureAuthenticated, user.account);
app.get('/admin', passportConf.ensureAuthenticated, passportConf.ensureAdmin(), user.getAdmin);
app.get('/partials/:name', home.partials);
app.get('/api', api.apiBrowser);
app.get('/api/foursquare', passportConf.ensureAuthenticated, api.foursquare);
app.get('/api/tumblr', passportConf.ensureAuthenticated, api.tumblr);
app.get('/contact', contact.getContact);
app.post('/contact', contact.postContact);
app.get('/auth/facebook', passport.authenticate('facebook', {
scope: [
'email'
]
}));
app.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' }));
app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' }));
app.get('/auth/google', passport.authenticate('google', {
scope: [
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'
]
}));
app.get('/auth/google/callback', passport.authenticate('google', {
successRedirect: '/',
failureRedirect: '/login'
}));
app.get('/auth/google', passport.authenticate('google', { scope: 'email' }));
app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' }));
app.get('/auth/foursquare', api.foursquareAuth);