Passport js local strategy custom callback showing user as false and info as “Missing credentials”

感情迁移 提交于 2019-11-29 17:23:47

Use { usernameField: 'email' } not { usernameField: 'Email' } because you send req.body.email not req.body.Email

Adding upto kaxi answer I have made to solve this error by adding password field in the passport local strategy as below

 passport.use(new LocalStrategy({ usernameField: 'Email',passwordField: 'Password'  }, (Email, Password, done) 

in place of

passport.use(new LocalStrategy({ usernameField: 'Email' }, (Email, Password, done)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!