mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
simplify updatedCipher (#14179)
This commit is contained in:
@@ -95,8 +95,7 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
|
|||||||
|
|
||||||
private confirmCredentialSubject = new Subject<boolean>();
|
private confirmCredentialSubject = new Subject<boolean>();
|
||||||
|
|
||||||
private createdCipher: Cipher = new Cipher();
|
private updatedCipher: CipherView;
|
||||||
private updatedCipher: CipherView = new CipherView();
|
|
||||||
|
|
||||||
private rpId = new BehaviorSubject<string>("");
|
private rpId = new BehaviorSubject<string>("");
|
||||||
private availableCipherIdsSubject = new BehaviorSubject<string[]>([""]);
|
private availableCipherIdsSubject = new BehaviorSubject<string[]>([""]);
|
||||||
@@ -238,14 +237,14 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
|
|||||||
return { cipherId: this.updatedCipher.id, userVerified: userVerification };
|
return { cipherId: this.updatedCipher.id, userVerified: userVerification };
|
||||||
} else {
|
} else {
|
||||||
// Create the credential
|
// Create the credential
|
||||||
await this.createCipher({
|
const createdCipher = await this.createCipher({
|
||||||
credentialName,
|
credentialName,
|
||||||
userName,
|
userName,
|
||||||
rpId,
|
rpId,
|
||||||
userHandle,
|
userHandle,
|
||||||
userVerification,
|
userVerification,
|
||||||
});
|
});
|
||||||
return { cipherId: this.createdCipher.id, userVerified: userVerification };
|
return { cipherId: createdCipher.id, userVerified: userVerification };
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// Make sure to clean up so the app is never stuck in modal mode?
|
// Make sure to clean up so the app is never stuck in modal mode?
|
||||||
@@ -306,7 +305,6 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const createdCipher = await this.cipherService.createWithServer(encCipher);
|
const createdCipher = await this.cipherService.createWithServer(encCipher);
|
||||||
this.createdCipher = createdCipher;
|
|
||||||
|
|
||||||
return createdCipher;
|
return createdCipher;
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user