Wednesday 6 April 2016

Passport-local. I can register a user, but when I try to log in it throws an error.

Hello. I am trying to set up my registration and login with Passport and I made a working copy of this tutorial http://ift.tt/1RPJ0F0 when I tried to integrate it to my project I am getting some odd results.On the linesapp.post('/login', passport.authenticate('local-login', { successRedirect : '/profile', // redirect to the secure profile section failureRedirect : '/login', // redirect back to the signup page if there is an error failureFlash : true // allow flash messages })); none of my flash messages are triggered the only feedback I get is the failureRedirect is the only thing that is called. I just went over the tutorial and my working copy cross referencing my code that isn't working, and I cant see for the life of me what would I can do to solve this.Instead of linking all my code, its the same code as the link above. The files of importants are app/routes config/passport.jsI have all the packages installed.Maybe some help on how to properly format errors? In the code there are if error { return done(err); }but I am unsure how to retrieve that data to see what its catching.So like I said, all the info I am getting right now is everything is working except when I try to login, I get the failureRedirect.here are my files if needed to see server.js config/passport.js app/routes.kjsThanks for any help

Submitted April 07, 2016 at 01:36AM by clandest

No comments:

Post a Comment