mirror of
https://github.com/bitwarden/browser.git
synced 2025-04-10 19:27:55 +02:00
allow overridable encrypt function
This commit is contained in:
parent
9b008ff382
commit
ef5eebba66
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user