Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

passport.authenticate inside a controller

//DECLARE DE REQUIRES

exports.createUser = (req, res, next) => {
    passport.authenticate('local-signup', {
        successRedirect : '/all', 
        failureRedirect : '/signup', 
        failureFlash : true 
    })(req, res, next); // -> IMPORTANT
};
 
PREVIOUS NEXT
Tagged: #controller
ADD COMMENT
Topic
Name
7+7 =