From 6af9026278034c95131f4b96ce776ab99dc95574 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Fri, 27 Sep 2024 18:55:52 +0200 Subject: [PATCH] chore: picks from conformance branch --- .../lib/authorization-request/AuthorizationRequest.ts | 3 ++- packages/siop-oid4vp/lib/rp/RP.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/siop-oid4vp/lib/authorization-request/AuthorizationRequest.ts b/packages/siop-oid4vp/lib/authorization-request/AuthorizationRequest.ts index 276e591a..5ec49f9b 100644 --- a/packages/siop-oid4vp/lib/authorization-request/AuthorizationRequest.ts +++ b/packages/siop-oid4vp/lib/authorization-request/AuthorizationRequest.ts @@ -66,7 +66,8 @@ export class AuthorizationRequest { const requestObjectArg = opts.requestObject.passBy !== PassBy.NONE ? (requestObject ? requestObject : await RequestObject.fromOpts(opts)) : undefined - const requestPayload = await createAuthorizationRequestPayload(opts, requestObjectArg) + // opts?.payload was removed before, but it's not clear atm why opts?.payload was removed + const requestPayload = opts?.payload ? await createAuthorizationRequestPayload(opts, requestObjectArg) : undefined return new AuthorizationRequest(requestPayload, requestObjectArg, opts) } diff --git a/packages/siop-oid4vp/lib/rp/RP.ts b/packages/siop-oid4vp/lib/rp/RP.ts index d0395a05..8ff7e371 100644 --- a/packages/siop-oid4vp/lib/rp/RP.ts +++ b/packages/siop-oid4vp/lib/rp/RP.ts @@ -166,13 +166,13 @@ export class RP { correlationId, }) correlationId = verifyAuthenticationResponseOpts.correlationId ?? correlationId - void this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_SUCCESS, { + await this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_SUCCESS, { correlationId, subject: authorizationResponse, }) const verifiedAuthorizationResponse = await authorizationResponse.verify(verifyAuthenticationResponseOpts) - void this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_SUCCESS, { + await this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_SUCCESS, { correlationId, subject: authorizationResponse, })