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(app.router);
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
// development only
|
// Development only
|
||||||
if ('development' === app.get('env')) {
|
if ('development' === app.get('env')) {
|
||||||
app.use(express.errorHandler());
|
app.use(express.errorHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Express Routes
|
// Login/Signup Routes
|
||||||
app.get('/', home.index);
|
app.get('/', home.index);
|
||||||
app.get('/login', user.getLogin);
|
app.get('/login', user.getLogin);
|
||||||
app.post('/login', user.postLogin);
|
app.post('/login', user.postLogin);
|
||||||
app.get('/logout', user.logout);
|
app.get('/logout', user.logout);
|
||||||
|
|
||||||
app.get('/signup', user.getSignup);
|
app.get('/signup', user.getSignup);
|
||||||
app.post('/signup', user.postSignup);
|
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.get('/account', passportConf.isAuthenticated, user.getAccount);
|
||||||
app.post('/account/profile', passportConf.isAuthenticated, user.postAccountProfileTab);
|
app.post('/account/profile', passportConf.isAuthenticated, user.postAccountProfileTab);
|
||||||
app.post('/account/settings', passportConf.isAuthenticated, user.postAccountSettingsTab);
|
app.post('/account/settings', passportConf.isAuthenticated, user.postAccountSettingsTab);
|
||||||
app.post('/account/delete', passportConf.isAuthenticated, user.postDeleteAccount);
|
app.post('/account/delete', passportConf.isAuthenticated, user.postDeleteAccount);
|
||||||
app.get('/account/unlink/:provider', passportConf.isAuthenticated, user.getOauthUnlink);
|
app.get('/account/unlink/:provider', passportConf.isAuthenticated, user.getOauthUnlink);
|
||||||
|
|
||||||
app.get('/api', api.getApi);
|
app.get('/api', api.getApi);
|
||||||
app.get('/api/foursquare', passportConf.isAuthenticated, passportConf.isAuthorized, api.getFoursquare);
|
app.get('/api/foursquare', passportConf.isAuthenticated, passportConf.isAuthorized, api.getFoursquare);
|
||||||
app.get('/api/tumblr', passportConf.isAuthenticated, passportConf.isAuthorized, api.getTumblr);
|
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/twitter', passportConf.isAuthenticated, api.getTwitter);
|
||||||
app.get('/api/aviary', api.getAviary);
|
app.get('/api/aviary', api.getAviary);
|
||||||
|
|
||||||
app.get('/contact', contact.getContact);
|
// OAuth Routes
|
||||||
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/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' }));
|
||||||
|
|
||||||
app.get('/auth/github', passport.authenticate('github'));
|
app.get('/auth/github', passport.authenticate('github'));
|
||||||
app.get('/auth/github/callback', passport.authenticate('github', { successRedirect: '/', failureRedirect: '/login' }));
|
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', passport.authenticate('google', { scope: 'profile email' }));
|
||||||
app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' }));
|
app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/', failureRedirect: '/login' }));
|
||||||
|
|
||||||
app.get('/auth/twitter', passport.authenticate('twitter'));
|
app.get('/auth/twitter', passport.authenticate('twitter'));
|
||||||
app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/', failureRedirect: '/login' }));
|
app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/', failureRedirect: '/login' }));
|
||||||
|
|
||||||
app.get('/auth/foursquare', passport.authorize('foursquare'));
|
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/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', passport.authorize('tumblr'));
|
||||||
app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), function(req, res) { res.redirect('/api/tumblr'); });
|
app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), function(req, res) { res.redirect('/api/tumblr'); });
|
||||||
|
|
||||||
|
@ -28,7 +28,5 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.control-label(for='username') Password
|
label.control-label(for='username') Password
|
||||||
input.form-control(type='password', name='password', id='password', placeholder='Password')
|
input.form-control(type='password', name='password', id='password', placeholder='Password')
|
||||||
.help-block
|
|
||||||
a.pull-right(href='#') Forgot password?
|
|
||||||
.form-group
|
.form-group
|
||||||
button.btn.btn-primary(type='submit') Login
|
button.btn.btn-primary(type='submit') Login
|
||||||
|
Reference in New Issue
Block a user