From 315b0766839b693540d8f5f576ace8e96715887c Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Thu, 4 Apr 2024 09:28:57 +0200 Subject: [PATCH] feat: Add option noStateMachinePersistence to VCI link handler to skip state machine persistence --- packages/oid4vci-holder/src/link-handler/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/oid4vci-holder/src/link-handler/index.ts b/packages/oid4vci-holder/src/link-handler/index.ts index 3b471daba..0ff9d70e6 100644 --- a/packages/oid4vci-holder/src/link-handler/index.ts +++ b/packages/oid4vci-holder/src/link-handler/index.ts @@ -10,16 +10,19 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter { private readonly stateNavigationListener: | ((oid4vciMachine: OID4VCIMachineInterpreter, state: OID4VCIMachineState, navigation?: any) => Promise) | undefined + private noStateMachinePersistence: boolean; constructor( args: Pick & { priority?: number | DefaultLinkPriorities protocols?: Array + noStateMachinePersistence?: boolean context: IAgentContext }, ) { super({ ...args, id: 'OID4VCIHolder' }) this.context = args.context + this.noStateMachinePersistence = args.noStateMachinePersistence === true this.stateNavigationListener = args.stateNavigationListener } @@ -48,6 +51,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter { cleanupAllOtherInstances: true, cleanupOnFinalState: true, singletonCheck: true, + noRegistration: this.noStateMachinePersistence }) if (hasCode) { interpreter.send(OID4VCIMachineEvents.PROVIDE_AUTHORIZATION_CODE_RESPONSE, { data: uri })