Passport: Unknown authentication strategy “local”

前端 未结 3 502
别那么骄傲
别那么骄傲 2021-02-04 02:52

I\'m new to NodeJS and I try to build a login/registration system. Registration works fine but I\'m currently unable to login.

I find a example app using passport and no

3条回答
  •  天命终不由人
    2021-02-04 03:41

    You forgot to import passport config file in your app.js.

    import passport config after initializing passport.

    app.use(passport.initialize());
    app.use(passport.session());
    // Add the line below, which you're missing:
    require('./path/to/passport/config/file')(passport);
    

    Hope this helps.

提交回复
热议问题