[PM-9959] Ensure cipherType defaults to CipherType.Login if none is available

This commit is contained in:
Shane Melton 2024-07-26 14:03:01 -07:00
parent 8827fd7067
commit 7090e3fa96
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ import { OpenAttachmentsComponent } from "../attachments/open-attachments/open-a
class QueryParams {
constructor(params: Params) {
this.cipherId = params.cipherId;
this.type = parseInt(params.type, null);
this.type = params.type != undefined ? parseInt(params.type, null) : undefined;
this.clone = params.clone === "true";
this.folderId = params.folderId;
this.organizationId = params.organizationId;
@ -56,7 +56,7 @@ class QueryParams {
/**
* The type of cipher to create.
*/
type: CipherType;
type?: CipherType;
/**
* Whether to clone the cipher.

View File

@ -48,7 +48,7 @@ export class DefaultCipherFormConfigService implements CipherFormConfigService {
return {
mode,
cipherType,
cipherType: cipher?.type ?? cipherType ?? CipherType.Login,
admin: false,
allowPersonalOwnership,
originalCipher: cipher,