Updated foursquare routes for authorization. Now properly retrives the Oauth token when app is authorized
This commit is contained in:
10
app.js
10
app.js
@@ -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);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user