From 73af28d0145a2d4abf59d954dd38c7e092ebd133 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Tue, 26 Nov 2013 23:22:07 -0500 Subject: [PATCH] Simplified google oauth route --- app.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/app.js b/app.js index ebae43ce0c..5a9ba1ca30 100755 --- a/app.js +++ b/app.js @@ -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);