I've just implemented a simple login using Passport.js and passport-local and everything seems to be working, except for the final redirect.
When i log in with bad credentials, I get an error, as it's supposed to happen.
But when I log in with the correct credentials, I get a 404 error for no apparent reason. Sources are too widespread to put here, so you can find them on GitHub: https://github.com/JacobCZ/nodewiki (look into config/express, config/passport, models/user and views/auth)
I noticed a typo on your app/controllers/auth.js
router.post('/login', passport.authenticate('local-login', {
sucecssRedirect: '/', // <== TYPO (successRedirect)
failureRedirect: '/login',
failureFlash: true
}));
That would probably explain it :)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments