screentinker/server/create_admin2.js
2026-07-26 14:06:26 +01:00

11 lines
392 B
JavaScript

const { db } = require('./db/database');
const bcrypt = require('bcryptjs');
const email = 'ivandro.work@gmail.com';
const password = '#whatever';
const hash = bcrypt.hashSync(password, 10);
db.prepare('UPDATE users SET password_hash = ?, role = ? WHERE email = ?').run(hash, 'platform_admin', email);
if (typeof db.sync === 'function') db.sync();
console.log('Password and role updated');