javascript - Passport with Express 4 -


i'm following guide implementing passport signup:

https://scotch.io/tutorials/easy-node-authentication-setup-and-local

everything works well, except passport not redirect on successful signup. code i'm using redirect on successful signup:

//  post        /signup router.post('/signup', passport.authenticate('local-signup', {     successredirect : '/dashboard',     failureredirect : '/signup',     failureflash: true })); 

i have verified user created in database. failureredirect works! it's on successredirect web page hangs it's not being redirected.

is there incompatibility issue passport , express 4 router? see examples of passport using app.post() instead of router.post().

thanks!

it looks you're deviating tutorial in you're using successredirect go page called dashboard, not profile. have updated app/routes.js file reflect ? app.get('/dashboard', isloggedin, function(req, res) {...}


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -