Add venmo authorize, callback and API urls, and a corresponding Venmo controller
parent
862ddb33fd
commit
45613cda0e
6
app.js
6
app.js
|
@ -123,6 +123,7 @@ app.get('/api/tumblr', passportConf.isAuthenticated, passportConf.isAuthorized,
|
|||
app.get('/api/facebook', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getFacebook);
|
||||
app.get('/api/github', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getGithub);
|
||||
app.get('/api/twitter', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getTwitter);
|
||||
app.get('/api/venmo', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getVenmo);
|
||||
|
||||
/**
|
||||
* OAuth routes for sign-in.
|
||||
|
@ -149,6 +150,11 @@ 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/venmo', passport.authorize('venmo', { scope: 'access_profile make_payments' }));
|
||||
app.get('/auth/venmo/callback', passport.authorize('venmo', { failureRedirect: '/api' }), function(req, res) {
|
||||
console.log('Success');
|
||||
res.redirect('/api/venmo');
|
||||
});
|
||||
|
||||
/**
|
||||
* Start Express server.
|
||||
|
|
|
@ -413,3 +413,9 @@ exports.postTwilio = function(req, res, next) {
|
|||
res.redirect('/api/twilio');
|
||||
});
|
||||
};
|
||||
|
||||
exports.getVenmo = function(req, res, next) {
|
||||
res.render('api/venmo', {
|
||||
title: 'Venmo API'
|
||||
});
|
||||
};
|
|
@ -34,3 +34,5 @@ block content
|
|||
small ⇢ Login Required
|
||||
li
|
||||
a(href='/api/scraping') Web Scraping
|
||||
li
|
||||
a(href='/api/venmo') Venmo
|
||||
|
|
Loading…
Reference in New Issue