Fix bug in accounts.js
parent
06765455f6
commit
23e85b7af3
|
@ -53,11 +53,11 @@ passport.deserializeUser((id, cb) => {
|
|||
|
||||
|
||||
async function generateHash(password) {
|
||||
const salt = bcrypt.genSaltSync();
|
||||
return bcrypt.hashSync(password, salt);
|
||||
}
|
||||
|
||||
async function create(email, password, isAdmin) {
|
||||
const salt = bcrypt.genSaltSync();
|
||||
const hash = await generateHash(password);
|
||||
|
||||
const query = `INSERT INTO accounts.users(email, password, admin)
|
||||
|
|
Reference in New Issue