passport js missing credentials

前端 未结 7 839
夕颜
夕颜 2020-12-31 02:03

Been working on this for a few hours now, pretty frustrating...

router.post(\'/\',
passport.authenticate(\'local-signup\', function(err, user, info) {
    co         


        
7条回答
  •  一个人的身影
    2020-12-31 02:32

    if you are using passport local mongoose as a plugin with your user model.

    Try this:

    passport.use(new LocalStrategy({
      usernameField: 'email'
    }, User.authenticate()));
    

提交回复
热议问题