Update seed and authentication with salt
This commit is contained in:
22
data/seeds/01-addUsers.js
Normal file
22
data/seeds/01-addUsers.js
Normal file
@@ -0,0 +1,22 @@
|
||||
require("dotenv").config();
|
||||
const bcrypt = require('bcryptjs');
|
||||
|
||||
exports.seed = function(knex) {
|
||||
return knex('users').truncate()
|
||||
.then(function () {
|
||||
return knex('users').insert([
|
||||
{
|
||||
id: 1,
|
||||
email: 'gabe@ls.com',
|
||||
username: 'gabe',
|
||||
password: bcrypt.hashSync('1234', process.env.SECRET, 10)
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
email: 'gabe2@ls.com',
|
||||
username: 'gabe2',
|
||||
password: bcrypt.hashSync('1234', process.env.SECRET, 10)
|
||||
}
|
||||
]);
|
||||
});
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
exports.seed = function(knex) {
|
||||
return knex('users').truncate()
|
||||
.then(function () {
|
||||
return knex('users').insert([
|
||||
// {
|
||||
// id: 1,
|
||||
// email: 'gabe@ls.com',
|
||||
// username: 'gabe',
|
||||
// password: '1234'
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// email: 'gabe2@ls.com',
|
||||
// username: 'gabe2',
|
||||
// password: '1234'
|
||||
// }
|
||||
]);
|
||||
});
|
||||
};
|
||||
Binary file not shown.
Reference in New Issue
Block a user