Login issue with Passport

时间:2019-05-31 11:40:05

标签: html node.js express passport.js

I am trying to make a login in my app, but it always fails. I use bcrypt to cipher password and passport package to implement the login rules, but still doesn't work.

I put passport initialization on app.js, register on router/user.js and login on routes/home.js.

The code: https://github.com/Coyas/wifyanywhereback

I try to put almost all code on router/user.js but it still fails.

// home.js //login com passporjs
router.post('/login', passport.authenticate(
    'local',
    {
        successRedirect: '/',
        failureRedirect: '/login'
    }
));

When I try to make login nothing appears, it only redirect me to login again.

0 个答案:

没有答案