diff --git a/packages/oid4vci-holder/src/agent/OID4VCIHolder.ts b/packages/oid4vci-holder/src/agent/OID4VCIHolder.ts index e318c6cff..b71cc7b35 100644 --- a/packages/oid4vci-holder/src/agent/OID4VCIHolder.ts +++ b/packages/oid4vci-holder/src/agent/OID4VCIHolder.ts @@ -386,9 +386,10 @@ export class OID4VCIHolder implements IAgentPlugin { authorizationResponse: JSON.parse(await client.exportState()).authorizationCodeResponse, }) if ('credential_definition' in issuanceOpt) { + const credentialType = issuanceOpt.credential_definition.type.length === 1? issuanceOpt.credential_definition.type[0]: issuanceOpt.credential_definition.type.filter(type=>type!='VerifiableCredential')[0] const credentialResponse = await client.acquireCredentials({ //fixme: this isn't the correct way to handle this. the type is wrong. we're not correctly handling moving from Record - credentialType: issuanceOpt.id ?? issuanceOpt.credential_definition.type[0], + credentialType: issuanceOpt.id ?? credentialType, proofCallbacks: callbacks, format: issuanceOpt.format, // TODO: We need to update the machine and add notifications support for actual deferred credentials instead of just waiting/retrying