19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
const bcrypt = require('bcrypt');
|
|
const Database = require('better-sqlite3');
|
|
|
|
const db = new Database('plusfit.db');
|
|
|
|
(async () => {
|
|
const username = 'admin';
|
|
const password = 'admin123';
|
|
|
|
const hash = await bcrypt.hash(password, 10);
|
|
|
|
db.prepare(`
|
|
INSERT OR IGNORE INTO admins (username, password)
|
|
VALUES (?, ?)
|
|
`).run(username, hash);
|
|
|
|
console.log('✅ Admin angelegt: admin / admin123');
|
|
})();
|