Verschieden Settings hinzugefügt (inkomplett)
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user