diff --git a/packages/openid4vc/src/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.ts b/packages/openid4vc/src/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.ts index 79a1075814..6a3128ea45 100644 --- a/packages/openid4vc/src/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.ts +++ b/packages/openid4vc/src/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.ts @@ -142,7 +142,10 @@ export class OpenId4VcRelyingPartyEventHandler { await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => { const verificationSession = await verificationSessionRepository.getById(agentContext, event.correlationId) - if (verificationSession.state === OpenId4VcVerificationSessionState.RequestUriRetrieved) { + if ( + verificationSession.state !== OpenId4VcVerificationSessionState.Error && + verificationSession.state !== OpenId4VcVerificationSessionState.ResponseVerified + ) { const previousState = verificationSession.state verificationSession.authorizationResponsePayload = event.subject.payload verificationSession.state = OpenId4VcVerificationSessionState.ResponseVerified