revised init db pw to pin, and check name routine

This commit is contained in:
2025-07-28 11:39:33 +02:00
parent 4406a86f44
commit dfa5c9ade1
8 changed files with 55 additions and 49 deletions

View File

@@ -12,7 +12,7 @@ db.exec(createSQLStmt);
// check if there are any users; if not add one default admin one
const userPassword = 'pass-123';
const hashedUserPassword = new jsSHA('SHA-512', 'TEXT').update(userPassword).getHash('HEX');
const checkInsertSQLStmt = `INSERT INTO users (name, pin) SELECT 'admin', '${hashedUserPassword}'
const checkInsertSQLStmt = `INSERT INTO users (name, pw) SELECT 'admin', '${hashedUserPassword}'
WHERE NOT EXISTS (SELECT * FROM users);`;
db.exec(checkInsertSQLStmt);