mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-09 19:28:06 +01:00
Handle empty password and uri fields when encrypting/decrypting
This commit is contained in:
parent
85efba92e6
commit
2ce1b12f6e
@ -24,9 +24,9 @@ angular
|
|||||||
folderId: encryptedSite.FolderId,
|
folderId: encryptedSite.FolderId,
|
||||||
favorite: encryptedSite.Favorite,
|
favorite: encryptedSite.Favorite,
|
||||||
name: cryptoService.decrypt(encryptedSite.Name),
|
name: cryptoService.decrypt(encryptedSite.Name),
|
||||||
uri: cryptoService.decrypt(encryptedSite.Uri),
|
uri: encryptedSite.Uri && encryptedSite.Uri !== '' ? cryptoService.decrypt(encryptedSite.Uri) : null,
|
||||||
username: encryptedSite.Username && encryptedSite.Username !== '' ? cryptoService.decrypt(encryptedSite.Username) : null,
|
username: encryptedSite.Username && encryptedSite.Username !== '' ? cryptoService.decrypt(encryptedSite.Username) : null,
|
||||||
password: cryptoService.decrypt(encryptedSite.Password),
|
password: encryptedSite.Password && encryptedSite.Password !== '' ? cryptoService.decrypt(encryptedSite.Password) : null,
|
||||||
notes: encryptedSite.Notes && encryptedSite.Notes !== '' ? cryptoService.decrypt(encryptedSite.Notes) : null
|
notes: encryptedSite.Notes && encryptedSite.Notes !== '' ? cryptoService.decrypt(encryptedSite.Notes) : null
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -79,10 +79,10 @@ angular
|
|||||||
'type': 1,
|
'type': 1,
|
||||||
folderId: unencryptedSite.folderId === '' ? null : unencryptedSite.folderId,
|
folderId: unencryptedSite.folderId === '' ? null : unencryptedSite.folderId,
|
||||||
favorite: unencryptedSite.favorite !== null ? unencryptedSite.favorite : false,
|
favorite: unencryptedSite.favorite !== null ? unencryptedSite.favorite : false,
|
||||||
uri: cryptoService.encrypt(unencryptedSite.uri, key),
|
uri: !unencryptedSite.uri || unencryptedSite.uri === '' ? null : cryptoService.encrypt(unencryptedSite.uri, key),
|
||||||
name: cryptoService.encrypt(unencryptedSite.name, key),
|
name: cryptoService.encrypt(unencryptedSite.name, key),
|
||||||
username: !unencryptedSite.username || unencryptedSite.username === '' ? null : cryptoService.encrypt(unencryptedSite.username, key),
|
username: !unencryptedSite.username || unencryptedSite.username === '' ? null : cryptoService.encrypt(unencryptedSite.username, key),
|
||||||
password: cryptoService.encrypt(unencryptedSite.password, key),
|
password: !unencryptedSite.password || unencryptedSite.password === '' ? null : cryptoService.encrypt(unencryptedSite.password, key),
|
||||||
notes: !unencryptedSite.notes || unencryptedSite.notes === '' ? null : cryptoService.encrypt(unencryptedSite.notes, key)
|
notes: !unencryptedSite.notes || unencryptedSite.notes === '' ? null : cryptoService.encrypt(unencryptedSite.notes, key)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -181,6 +181,9 @@
|
|||||||
success(folders, sites, siteRelationships);
|
success(folders, sites, siteRelationships);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
error();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
reader.onerror = function (evt) {
|
reader.onerror = function (evt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user