Refactoring, removed forgot password placeholder
This commit is contained in:
18
app.js
18
app.js
@ -40,26 +40,27 @@ app.use(less({ src: __dirname + '/public', compress: true }));
|
||||
app.use(app.router);
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// development only
|
||||
// Development only
|
||||
if ('development' === app.get('env')) {
|
||||
app.use(express.errorHandler());
|
||||
}
|
||||
|
||||
// Express Routes
|
||||
// Login/Signup Routes
|
||||
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);
|
||||
|
||||
// Primary Routes
|
||||
app.get('/contact', contact.getContact);
|
||||
app.post('/contact', contact.postContact);
|
||||
app.get('/account', passportConf.isAuthenticated, user.getAccount);
|
||||
app.post('/account/profile', passportConf.isAuthenticated, user.postAccountProfileTab);
|
||||
app.post('/account/settings', passportConf.isAuthenticated, user.postAccountSettingsTab);
|
||||
app.post('/account/delete', passportConf.isAuthenticated, user.postDeleteAccount);
|
||||
app.get('/account/unlink/:provider', passportConf.isAuthenticated, user.getOauthUnlink);
|
||||
|
||||
app.get('/api', api.getApi);
|
||||
app.get('/api/foursquare', passportConf.isAuthenticated, passportConf.isAuthorized, api.getFoursquare);
|
||||
app.get('/api/tumblr', passportConf.isAuthenticated, passportConf.isAuthorized, api.getTumblr);
|
||||
@ -71,24 +72,17 @@ app.get('/api/nyt', api.getNewYorkTimes);
|
||||
app.get('/api/twitter', passportConf.isAuthenticated, api.getTwitter);
|
||||
app.get('/api/aviary', api.getAviary);
|
||||
|
||||
app.get('/contact', contact.getContact);
|
||||
app.post('/contact', contact.postContact);
|
||||
|
||||
// OAuth Routes
|
||||
app.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' }));
|
||||
app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' }));
|
||||
|
||||
app.get('/auth/github', passport.authenticate('github'));
|
||||
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/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' }));
|
||||
|
||||
app.get('/auth/twitter', passport.authenticate('twitter'));
|
||||
app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/', failureRedirect: '/login' }));
|
||||
|
||||
app.get('/auth/foursquare', passport.authorize('foursquare'));
|
||||
app.get('/auth/foursquare/callback', passport.authorize('foursquare', { failureRedirect: '/api' }), function(req, res) { res.redirect('/api/foursquare'); });
|
||||
|
||||
app.get('/auth/tumblr', passport.authorize('tumblr'));
|
||||
app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), function(req, res) { res.redirect('/api/tumblr'); });
|
||||
|
||||
|
Reference in New Issue
Block a user