OwlCyberSecurity - MANAGER
Edit File: hashPassword.mjs
import bcrypt from 'bcrypt'; // If using ES Modules (.mjs) const plainPassword = req.body.password; // Get password from user input const hashedPassword = await bcrypt.hash(plainPassword, 10); // Then insert into MySQL: await db.execute( 'INSERT INTO Employee (EmpNo, password) VALUES (?, ?)', [req.body.EmpNo, hashedPassword] );