Skip to content

Commit

Permalink
feat: Add option noStateMachinePersistence to VCI link handler to ski…
Browse files Browse the repository at this point in the history
…p state machine persistence
  • Loading branch information
nklomp committed Apr 4, 2024
1 parent 4cc567a commit 315b076
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/oid4vci-holder/src/link-handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
private readonly stateNavigationListener:
| ((oid4vciMachine: OID4VCIMachineInterpreter, state: OID4VCIMachineState, navigation?: any) => Promise<void>)
| undefined
private noStateMachinePersistence: boolean;

constructor(
args: Pick<GetMachineArgs, 'stateNavigationListener'> & {
priority?: number | DefaultLinkPriorities
protocols?: Array<string | RegExp>
noStateMachinePersistence?: boolean
context: IAgentContext<IOID4VCIHolder & IMachineStatePersistence>
},
) {
super({ ...args, id: 'OID4VCIHolder' })
this.context = args.context
this.noStateMachinePersistence = args.noStateMachinePersistence === true
this.stateNavigationListener = args.stateNavigationListener
}

Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit 315b076

Please sign in to comment.