allow overridable encrypt function

This commit is contained in:
Kyle Spearrin 2018-07-05 10:10:15 -04:00
parent 9b008ff382
commit ef5eebba66
1 changed files with 7 additions and 3 deletions

View File

@ -157,13 +157,13 @@ export class AddEditComponent {
return false;
}
if (!this.editMode && this.cipher.type === CipherType.Login && this.cipher.login.uris.length === 1 &&
if (!this.editMode && this.cipher.type === CipherType.Login &&
this.cipher.login.uris != null && this.cipher.login.uris.length === 1 &&
(this.cipher.login.uris[0].uri == null || this.cipher.login.uris[0].uri === '')) {
this.cipher.login.uris = null;
}
const cipher = await this.cipherService.encrypt(this.cipher);
const cipher = await this.encryptCipher();
try {
this.formPromise = this.saveCipher(cipher);
await this.formPromise;
@ -311,6 +311,10 @@ export class AddEditComponent {
return this.cipherService.get(this.cipherId);
}
protected encryptCipher() {
return this.cipherService.encrypt(this.cipher);
}
protected saveCipher(cipher: Cipher) {
return this.cipherService.saveWithServer(cipher);
}