diff --git a/app.js b/app.js index 0a21948ca2..0d33804b36 100755 --- a/app.js +++ b/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'); }); diff --git a/views/login.jade b/views/login.jade index 08fe3ea3a1..13fd7ed68e 100644 --- a/views/login.jade +++ b/views/login.jade @@ -28,7 +28,5 @@ block content .form-group label.control-label(for='username') Password input.form-control(type='password', name='password', id='password', placeholder='Password') - .help-block - a.pull-right(href='#') Forgot password? .form-group button.btn.btn-primary(type='submit') Login