Create a Compatibility namespace
This commit is contained in:
parent
202a047edc
commit
1b0f6836dc
14 changed files with 257 additions and 275 deletions
|
|
@ -8,7 +8,7 @@ function EncryptedInsightStorage(config) {
|
|||
inherits(EncryptedInsightStorage, InsightStorage);
|
||||
|
||||
EncryptedInsightStorage.prototype.getItem = function(name, callback) {
|
||||
var key = cryptoUtil.kdf(this.password, this.email);
|
||||
var key = cryptoUtil.kdf(this.password + this.email);
|
||||
InsightStorage.prototype.getItem.apply(this, [name,
|
||||
function(err, body) {
|
||||
var decryptedJson = cryptoUtil.decrypt(key, body);
|
||||
|
|
@ -21,13 +21,13 @@ EncryptedInsightStorage.prototype.getItem = function(name, callback) {
|
|||
};
|
||||
|
||||
EncryptedInsightStorage.prototype.setItem = function(name, value, callback) {
|
||||
var key = cryptoUtil.kdf(this.password, this.email);
|
||||
var key = cryptoUtil.kdf(this.password + this.email);
|
||||
var record = cryptoUtil.encrypt(key, value);
|
||||
InsightStorage.prototype.setItem.apply(this, [name, record, callback]);
|
||||
};
|
||||
|
||||
EncryptedInsightStorage.prototype.removeItem = function(name, callback) {
|
||||
var key = cryptoUtil.kdf(this.password, this.email);
|
||||
var key = cryptoUtil.kdf(this.password + this.email);
|
||||
InsightStorage.prototype.removeItem.apply(this, [name, callback]);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue