3 Commits

Author SHA1 Message Date
5a06c99fb7 Merge pull request 'f077_default_admin_password' (#22) from f077_default_admin_password into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #22
Reviewed-by: jared <jared.busch@polizei.niedersachsen.de>
2025-07-31 08:40:14 +02:00
b3e2b297a3 change default admin password 2025-07-31 08:33:03 +02:00
b655df1087 fix changing of PIN on upload page 2025-07-31 08:13:55 +02:00
2 changed files with 3 additions and 3 deletions

View File

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

View File

@@ -35,9 +35,9 @@ export const actions = {
const vorgang = getVorgangByName(vorgangName); const vorgang = getVorgangByName(vorgangName);
vorgangToken = vorgang.token; vorgangToken = vorgang.token;
if (vorgang && vorgang.pin != vorgangPIN) { if (vorgang && vorgang.pin != vorgangPIN) {
const updateSQLStmt = `UPDATE cases SET pin = ? WHERE name = ?`; const updateSQLStmt = `UPDATE cases SET pin = ? WHERE token = ?`;
const statement = db.prepare(updateSQLStmt); const statement = db.prepare(updateSQLStmt);
statement.run(vorgangPIN, vorgang); statement.run(vorgangPIN, vorgangToken);
} }
} }