Verschieden Settings hinzugefügt (inkomplett)

This commit is contained in:
Torsten Schulz
2024-07-22 20:55:33 +02:00
parent 89842ff6c5
commit 4c12303edc
23 changed files with 269 additions and 208 deletions

View File

@@ -28,11 +28,9 @@ const UserParam = sequelize.define('user_param', {
if (value) {
try {
const iv = generateIv();
console.log(value);
this.setDataValue('iv', iv.toString('hex'));
this.setDataValue('value', encrypt(value, iv));
this.setDataValue('value', encrypt(value.toString(), iv));
} catch (error) {
console.log('Error setting value:', error);
this.setDataValue('value', '');
}
}
@@ -43,7 +41,6 @@ const UserParam = sequelize.define('user_param', {
const iv = Buffer.from(this.getDataValue('iv'), 'hex');
return decrypt(value, iv);
} catch (error) {
console.log('Error getting value:', error);
return '';
}
}