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
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #22 Reviewed-by: jared <jared.busch@polizei.niedersachsen.de>
This commit was merged in pull request #22.
This commit is contained in:
@@ -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);`;
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user