Created isAuthorized middleware

This commit is contained in:
Sahat Yalkabov
2013-12-08 02:10:49 -05:00
parent 06db58c554
commit 51001a0497
3 changed files with 15 additions and 2 deletions

View File

@ -100,6 +100,7 @@ exports.getTumblr = function(req, res) {
exports.getFacebook = function(req, res) {
var token = _.findWhere(req.user.tokens, { kind: 'facebook' });
// TODO: MIDDLEWARE
// TODO: OR just redirect directly to /auth/facebook
if (!token) {
return res.render('api/unauthorized', {
title: 'Facebook API',