Update seed and authentication with salt
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
require("dotenv").config();
|
||||
const router = require('express').Router();
|
||||
const bcrypt = require('bcryptjs');
|
||||
|
||||
@@ -6,7 +7,7 @@ const Users = require('../users/usersModel');
|
||||
|
||||
router.post('/register', (req, res) => {
|
||||
let user = req.body;
|
||||
const hash = bcrypt.hashSync(user.password, 10);
|
||||
const hash = bcrypt.hashSync(user.password, process.env.SECRET, 10);
|
||||
user.password = hash;
|
||||
|
||||
Users.addUser(user)
|
||||
|
||||
Reference in New Issue
Block a user