aboutsummaryrefslogtreecommitdiff
path: root/controllers/user.js
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/user.js')
-rw-r--r--controllers/user.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/controllers/user.js b/controllers/user.js
index 54b8161..980fc12 100644
--- a/controllers/user.js
+++ b/controllers/user.js
@@ -1,4 +1,5 @@
const User = require('../models/user');
+const bcrypt = require('bcryptjs');
module.exports = {
@@ -8,7 +9,7 @@ module.exports = {
firstname: req.body.firstname,
lastname: req.body.lastname,
email: req.body.email,
- password: req.body.password
+ password: bcrypt.hashSync(req.body.password)
});
newUser.save().then(() => {
req.flash('msg', 'You successfully registered.');