vendredi 6 mars 2015

How can I add additional information from a post object to register a user in passport?

I am trying to register a user through passport-local with the following snippet:



router.post('/signup', passport.authenticate('signup', {
successRedirect: '/home',
failureRedirect: '/signup',
failureFlash : true
}));


I am using a user model which apart from the data sending through the post method, I would like to add a "userCreated" and "lastAccess" Date property. They are already defined on the user model, but, how can I add these two variables to the post information, and then pass it to passport to create the user?


Thanks!


Aucun commentaire:

Enregistrer un commentaire