mongoose-auth exceptions



当我将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插件之后使用。

相关内容

最新更新