Replaced _.findWhere with .find function

This commit is contained in:
Sahat Yalkabov
2014-06-06 16:02:37 -04:00
parent d14bec326c
commit b05c12d6d4
2 changed files with 12 additions and 11 deletions

View File

@@ -400,7 +400,7 @@ exports.isAuthenticated = function(req, res, next) {
exports.isAuthorized = function(req, res, next) {
var provider = req.path.split('/').slice(-1)[0];
if (_.findWhere(req.user.tokens, { kind: provider })) {
if (_.find(req.user.tokens, { kind: provider })) {
next();
} else {
res.redirect('/auth/' + provider);