design change

This commit is contained in:
BIG2EYEZ
2024-01-20 18:05:42 +08:00
parent 13c1959925
commit 2365ea9ede
7 changed files with 548 additions and 330 deletions

View File

@ -370,14 +370,15 @@ app.post(
}
// Hash the password
const hashedPassword = await bcrypt.hash(password, 10);
const saltRounds = 10;
const hashedPassword = await bcrypt.hash(password, saltRounds);
// Start a transaction
const t = await sequelize.transaction();
try {
// Create the user
const newUser = await User.create({
await User.create({
name,
username,
email,
@ -535,8 +536,9 @@ app.post("/forgot-password", async (req, res) => {
});
}
// Hash the new password
const hashedPassword = await bcrypt.hash(sanitizedPassword, 10);
// Hash the new password
const saltRounds = 10;
const hashedPassword = await bcrypt.hash(sanitizedPassword, saltRounds);
// Update user's password and clear reset token
const updateQuery = {