Replaced _.findWhere with .find function
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user