无法在nodejs中读取未定义的属性“then”

时间:2016-01-21 08:12:36

标签: javascript node.js express passport.js

我不知道为什么我在代码中遇到了这个错误。

TreeSet

2 个答案:

答案 0 :(得分:4)

您应该在第二个原始广告中添加return before auth.findOne

var fineOneBySocialLogin = function (req, res) {
  return  auth.findOne({ username: req.emails[0].value }).then(...

答案 1 :(得分:2)

应该是 return auth.findOne(...

相关问题