Simplified google oauth route
This commit is contained in:
23
app.js
23
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);
|
||||
|
Reference in New Issue
Block a user