Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- function processSignup(req,res){
- var newUser = new User({
- email: req.body.email,
- name: req.body.name,
- password: req.body.password,
- });
- bcrypt.hash(newUser.password , 10 ,function(err,hash){
- if(err) throw err;
- newUser.password = hash;
- newUser.save()
- .then(() => {
- req.flash("success", "Bạn đã đăng kí account success !!!");
- res.redirect("login");
- }
- )
- .catch(err => res.send(err))
- })
- }
- function showLogin(req,res){
- res.render("user/login" , {
- success: req.flash("success")
- })
- }
Add Comment
Please, Sign In to add comment