migrate to unencrypted if encrypted

This commit is contained in:
Matias Alejo Garcia 2015-11-07 12:13:06 -03:00
parent e78adf1bb8
commit 8e20c194d4
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ angular.module('copayApp.services')
try {
text = sjcl.decrypt(uuid, text);
$log.info('Migrating to unencrypted profile');
return storage.set('profile', text, function(err) {
return cb(err, text);
});
} catch(e) {
$log.warn('Decrypt error: ', e);
return cb('Could not decrypt storage: device ID mismatch');