Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerUser(params, callback) {
- var sql = "INSERT INTO users_data (first_name, last_name, email, role, registration_date, active, password) VALUES ('"+params.fName+"', '"+params.lName+"', '"+params.email+"', '"+params.role+"', '"+params.date+"', '"+1+"', '"+params.hashedPass+"')";
- con.query(sql, function (err, result) {
- if (err) throw err;
- callback(result);
- });
- }
- bcrypt.genSalt(saltRounds, function(err, salt){
- bcrypt.hash(query.password, salt, function(err, hashedPass){
- console.log(hashedPass); //I get the hash printed here with no problems
- write.registerUser({
- data,
- fName,
- lName,
- email,
- role,
- date,
- hashedPass
- }, function(results){
- console.log(results)
- return();
- });
- });
- });
Add Comment
Please, Sign In to add comment