Adds Steam auth and API

This commit is contained in:
Karl Jakober
2014-02-05 16:37:48 +00:00
parent 1ff27464fe
commit aa36ad9fbb
8 changed files with 117 additions and 3 deletions

6
app.js
View File

@@ -118,6 +118,8 @@ app.get('/api/aviary', apiController.getAviary);
app.get('/api/paypal', apiController.getPayPal);
app.get('/api/paypal/success', apiController.getPayPalSuccess);
app.get('/api/paypal/cancel', apiController.getPayPalCancel);
app.get('/api/steam', passportConf.isAuthorized, passportConf.isAuthorized, apiController.getSteam);
/**
* OAuth routes for sign-in.
@@ -144,6 +146,10 @@ 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/steam', passport.authenticate('steam'));
app.get('/auth/steam/callback', passport.authenticate('steam', { failureRedirect: '/login' }), function(req, res) {
res.redirect('/api/steam');
});
app.listen(app.get('port'), function() {
console.log("✔ Express server listening on port %d in %s mode", app.get('port'), app.settings.env);