【问题标题】:node.js everyauth twitter mongodb error: You are trying to access the attribute/method configured by `findUserById`, which you did not configure?node.js everyauth twitter mongodb 错误:您正在尝试访问您未配置的`findUserById` 配置的属性/方法?
【发布时间】:2012-10-17 20:24:17
【问题描述】:

findOrCreateUser 函数中,我返回一个promise,然后我使用来自 mongoDB 的用户文档来完成它。

然后它给出了这个错误You are trying to access the attribute/method configured by findUserById, which you did not configure

我使用了这个人的教程http://nodetuts.com/tutorials/26-starting-with-everyauth.html#video 他没有做任何事情。为什么它甚至需要一个findUserById 函数?我将返回整个文档,而不仅仅是一个 ID。

所以,是的,我该如何纠正这个问题?我想在你返回你的promise 之后,everyauth 就可以开始了。

【问题讨论】:

    标签: node.js everyauth


    【解决方案1】:

    不确定你是否已经解决了这个问题,但我发现在你开始告诉它之前添加了以下 api id 和秘密为我排序:

    everyauth.everymodule
      .findUserById( function (id, callback) {
        callback(null, usersById[id]);
      });
    

    【讨论】:

    • 你知道为什么它需要findUserById 或者它用它做什么吗?
    • 它使用它来使用户对象在 req.user 上可用
    猜你喜欢
    • 2012-04-02
    • 2022-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-05
    • 2015-07-20
    • 2018-11-30
    • 2016-12-01
    相关资源
    最近更新 更多