Updated foursquare routes for authorization. Now properly retrives the Oauth token when app is authorized

This commit is contained in:
Sahat Yalkabov
2013-11-19 17:09:05 -05:00
parent 7bef3acaf3
commit 58457a58e7
4 changed files with 38 additions and 19 deletions

10
app.js
View File

@@ -6,6 +6,7 @@ var express = require('express'),
mongoose = require('mongoose'),
passport = require('passport');
// TODO: Add node-opencv!!
// App Configuration (API Keys, Database URI)
var config = require('./config/config.json');
@@ -67,19 +68,16 @@ app.post('/contact', contact.postContact);
// Redirect the user to Facebook for authentication. When complete,
// Facebook will redirect the user back to the application at
app.get('/auth/facebook', passport.authenticate('facebook'));
// Facebook will redirect the user to this URL after approval. Finish the
// authentication process by attempting to obtain an access token. If
// access was granted, the user will be logged in. Otherwise,
// authentication has failed.
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);