温馨提示:本文翻译自stackoverflow.com,查看原文请点击:node.js - Can anyone help me with this error related to passportjs

node.js - 谁能帮我解决与passportjs相关的错误

发布于 2020-03-28 23:21:09
ReferenceError: User is not defined
    at Strategy._verify (C:\Projects\config\passport.js:9:5)
    at Strategy.authenticate (C:\Projects\node_modules\passport-local\lib\strategy.js:90:12)
    at attempt (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:366:16)
    at authenticate (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:367:7)
    at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Projects\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Projects\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)
    at C:\Projects\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\Projects\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Projects\node_modules\express\lib\router\index.js:275:10)
    at SessionStrategy.strategy.pass (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:343:9)
    at SessionStrategy.authenticate (C:\Projects\node_modules\passport\lib\strategies\session.js:75:10)
    at attempt (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:366:16)
    at authenticate (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:367:7)
    at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)

查看更多

查看更多

提问者
Akanksha Shahi
被浏览
43
mohamed ibrahim 2020-01-31 19:19

您必须在models.js中创建一个用户模式,并将其导出到您的通行证配置文件

发布
问题

分享
好友

手机
浏览

扫码手机浏览