未知的身份验证策略" local",nodejs-mysql

时间:2015-11-25 18:14:11

标签: mysql angularjs node.js passport.js

我正在开发Angular-node-mysql应用程序。我正在尝试使用passport.js实现登录功能。我收到错误"未知的身份验证策略" local"。我在线检查了其他帖子,但未能解决问题。我使用了参考: Github reference enter image description here

我的代码:server.js enter image description here enter image description here

enter image description here

我在浏览器上看到错误:enter image description here

我无法弄清楚我的错误

1 个答案:

答案 0 :(得分:0)

您将策略命名为“local-login”。尝试更改

app.post("/login", passport.authenticate('local') .....

app.post("/login", passport.authenticate('local-login') .....