OwlCyberSecurity - MANAGER
Edit File: seed-user.js
import bcrypt from 'bcrypt'; import pool from './db.js'; // Make sure this is your working pool config const seedUser = async () => { const username = 'admin'; const password = 'admin12345'; const role = 'admin'; try { const hashedPassword = await bcrypt.hash(password, 10); const conn = await pool.getConnection(); await conn.execute( 'INSERT INTO login (username, password, role) VALUES (?, ?, ?)', [username, hashedPassword, role] ); conn.release(); console.log('✅ User inserted with hashed password'); } catch (err) { console.error('❌ Error inserting user:', err.message); } }; seedUser();