From 29f3a23e96b3e395a959d0cb9e213f4ad26e91fc Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 9 Jan 2025 12:41:43 +0100 Subject: [PATCH 1/2] chore: Select AssertionProofPurpose when only challenge is missing --- packages/vc-handler-ld-local/src/ld-credential-module.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/vc-handler-ld-local/src/ld-credential-module.ts b/packages/vc-handler-ld-local/src/ld-credential-module.ts index e2cbb4ff8..2189b607d 100644 --- a/packages/vc-handler-ld-local/src/ld-credential-module.ts +++ b/packages/vc-handler-ld-local/src/ld-credential-module.ts @@ -115,7 +115,7 @@ export class LdCredentialModule { verificationMethodId: string, challenge: string | undefined, domain: string | undefined, - purpose: typeof ProofPurpose = !challenge && !domain + purpose: typeof ProofPurpose = !challenge ? new AssertionProofPurpose() : new AuthenticationProofPurpose({ domain, @@ -212,9 +212,7 @@ export class LdCredentialModule { domain: string | undefined, context: IAgentContext, fetchRemoteContexts = false, - presentationPurpose: typeof ProofPurpose = !challenge && !domain - ? new AssertionProofPurpose() - : new AuthenticationProofPurpose({ domain, challenge }), + presentationPurpose: typeof ProofPurpose = !challenge ? new AssertionProofPurpose() : new AuthenticationProofPurpose({ domain, challenge }), checkStatus?: Function, //AssertionProofPurpose() ): Promise { From 1a2419b7d8a3b161f2d451f9f5343b814982e19c Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 9 Jan 2025 12:41:43 +0100 Subject: [PATCH 2/2] chore: Select AssertionProofPurpose when only challenge is missing --- packages/vc-handler-ld-local/src/ld-credential-module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vc-handler-ld-local/src/ld-credential-module.ts b/packages/vc-handler-ld-local/src/ld-credential-module.ts index e2cbb4ff8..4bce8b059 100644 --- a/packages/vc-handler-ld-local/src/ld-credential-module.ts +++ b/packages/vc-handler-ld-local/src/ld-credential-module.ts @@ -115,7 +115,7 @@ export class LdCredentialModule { verificationMethodId: string, challenge: string | undefined, domain: string | undefined, - purpose: typeof ProofPurpose = !challenge && !domain + purpose: typeof ProofPurpose = !challenge // domain is not a mandatory var for AuthenticationProofPurpose per se, but challenge is. ? new AssertionProofPurpose() : new AuthenticationProofPurpose({ domain, @@ -212,7 +212,7 @@ export class LdCredentialModule { domain: string | undefined, context: IAgentContext, fetchRemoteContexts = false, - presentationPurpose: typeof ProofPurpose = !challenge && !domain + presentationPurpose: typeof ProofPurpose = !challenge // domain is not a mandatory var for AuthenticationProofPurpose per se, but challenge is. ? new AssertionProofPurpose() : new AuthenticationProofPurpose({ domain, challenge }), checkStatus?: Function,