diff --git a/libs/common/src/vault/models/view/cipher.view.ts b/libs/common/src/vault/models/view/cipher.view.ts index 1c3a1da2f70..878181fa1cc 100644 --- a/libs/common/src/vault/models/view/cipher.view.ts +++ b/libs/common/src/vault/models/view/cipher.view.ts @@ -286,27 +286,7 @@ export class CipherView implements View, InitializerMetadata { cipherView.folderId = uuidAsString(obj.folderId); cipherView.name = obj.name; cipherView.notes = obj.notes; - - // SDK returns type as a discriminated union object, extract the actual CipherType - const sdkType: CipherViewType | CipherType = (obj.type as any) ?? CipherType.Login; - - // Handle both discriminated union format and numeric CipherType - if (typeof sdkType === "number") { - cipherView.type = sdkType; - } else if (typeof sdkType === "object" && sdkType !== null) { - if ("login" in sdkType) { - cipherView.type = CipherType.Login; - } else if ("card" in sdkType) { - cipherView.type = CipherType.Card; - } else if ("identity" in sdkType) { - cipherView.type = CipherType.Identity; - } else if ("secureNote" in sdkType) { - cipherView.type = CipherType.SecureNote; - } else if ("sshKey" in sdkType) { - cipherView.type = CipherType.SshKey; - } - } - + cipherView.type = obj.type ?? CipherType.Login; cipherView.favorite = obj.favorite; cipherView.organizationUseTotp = obj.organizationUseTotp; cipherView.permissions = obj.permissions