From 55de39f30e4683f511ea3bdf173c6e49f20db59b Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Tue, 19 Nov 2013 17:12:36 -0500 Subject: [PATCH] Login requirement to view Foursquare API page --- app.js | 15 ++++++--------- views/api.jade | 4 +++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index 75140409ff..eef2c1dea3 100755 --- a/app.js +++ b/app.js @@ -60,24 +60,21 @@ app.get('/admin', passportConf.ensureAuthenticated, passportConf.ensureAdmin(), app.get('/partials/:name', home.partials); app.get('/api', api.apiBrowser); -app.get('/api/foursquare', api.foursquare); -app.get('/api/foursquare/callback', api.foursquareCallback); +app.get('/api/foursquare', passportConf.ensureAuthenticated, api.foursquare); app.get('/contact', contact.getContact); app.post('/contact', contact.postContact); - +/** + * Authentication Routes + */ app.get('/auth/facebook', passport.authenticate('facebook')); -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/foursquare', api.foursquareAuth); app.get('/auth/foursquare/callback', api.foursquareCallback); + app.get('*', home.index); diff --git a/views/api.jade b/views/api.jade index b430493628..2b69d98c4d 100644 --- a/views/api.jade +++ b/views/api.jade @@ -1,4 +1,6 @@ extends layout block content - h1 API Browser \ No newline at end of file + h1 API Browser + + a(href='/api/foursquare') Foursquare \ No newline at end of file