fixes notification for invalid credentials

This commit is contained in:
Matias Pando 2014-10-28 18:06:32 -03:00
commit b08ccb6111
6 changed files with 24 additions and 18 deletions

View file

@ -9,13 +9,15 @@ inherits(EncryptedLocalStorage, LocalStorage);
EncryptedLocalStorage.prototype.getItem = function(name, callback) {
var key = cryptoUtil.kdf(this.password + this.email);
LocalStorage.prototype.getItem.apply(this, [name, function(err, body) {
var decryptedJson = cryptoUtil.decrypt(key, body);
if (!decryptedJson) {
return callback('Internal Error');
LocalStorage.prototype.getItem.apply(this, [name,
function(err, body) {
var decryptedJson = cryptoUtil.decrypt(key, body);
if (!decryptedJson) {
return callback('PNOTFOUND');
}
return callback(null, decryptedJson);
}
return callback(null, decryptedJson);
}]);
]);
};
EncryptedLocalStorage.prototype.setItem = function(name, value, callback) {