August 2016
Intermediate to advanced
376 pages
6h 33m
English
At this point, we have enough code to configure secure access to our application. However, we still need to add a few more lines to the login and sign-up forms to make them work properly:
server/routes/index.js and add the following lines after the login GET route: /* POST login */
router.post('/login', passport.authenticate('local-login', {
//Success go to Profile Page / Fail go to login page
successRedirect : '/profile',
failureRedirect : '/login',
failureFlash : true
}));
signup GET route: /* POST Signup */ router.post('/signup', passport.authenticate('local-signup', { //Success go to Profile Page / Fail go to Signup page successRedirect : ...Read now
Unlock full access