mardi 16 mars 2021

Please help Im always getting an error in this throw keyword

bcrypt.genSalt(10, (err, salt) => bcrypt.hash(newUser.password, 10, (err, hash) => { if(err) throw err; // SET PASSWORD TO HASHED newUser.password = hash; // SAVE USER newUser.save() .then(User => { req.flash('success_msg', 'You are now registered') res.redirect('/users/login') }) .catch(err => console.log(err)); }))

Aucun commentaire:

Enregistrer un commentaire