gpt4 book ai didi

Mongoose 身份验证异常

转载 作者:行者123 更新时间:2023-12-02 22:30:32 39 4
gpt4 key购买 nike

当我将 mongoose-auth 添加到 server.js 时,出现以下异常,但我不确定问题是什么。有人可以帮忙

  exports.helpExpress = everyauth.helpExpress.bind(everyauth);
} has no method 'middleware'
at HTTPServer.<anonymous> (/home/x/x/settings.js:44:26)
at HTTPServer.configure (/home/x/x/node_modules/express/lib/http.js:543:61)
at bootApplication (/home/x/x/settings.js:27:7)
at Object.boot (/home/x/x/settings.js:21:3)
at Object.<anonymous> (/home/x/x/app.js:4:23)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)

最佳答案

请引用此帖子https://github.com/bnoguchi/mongoose-auth/issues/20 (tsabolov 的评论在最后)。

app.use(mongooseAuth.middleware()) 必须在声明 Schema 插件后使用。

关于 Mongoose 身份验证异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8290377/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com