1
0
mirror of https://github.com/bitwarden/web synced 2025-12-10 13:23:15 +00:00

change email/password adjustments

This commit is contained in:
Kyle Spearrin
2017-04-17 14:53:26 -04:00
parent aa7a3c442c
commit bc431b896b
4 changed files with 35 additions and 5 deletions

View File

@@ -39,13 +39,23 @@
reencryptedFolders = cipherService.encryptFolders(unencryptedFolders, _newKey);
}).$promise;
var privateKey = cryptoService.getPrivateKey('raw'),
reencryptedPrivateKey = null;
if (privateKey) {
reencryptedPrivateKey = cryptoService.encrypt(privateKey, _newKey, 'raw');
}
$q.all([loginsPromise, foldersPromise]).then(function () {
var request = {
token: model.token,
newEmail: model.newEmail.toLowerCase(),
masterPasswordHash: _masterPasswordHash,
newMasterPasswordHash: _newMasterPasswordHash,
ciphers: reencryptedLogins.concat(reencryptedFolders)
data: {
ciphers: reencryptedLogins,
folders: reencryptedFolders,
privateKey: reencryptedPrivateKey
}
};
$scope.confirmPromise = apiService.accounts.email(request, function () {