Skip to content

Commit

Permalink
fix: a bug in selecting the type of the credential that we're going t…
Browse files Browse the repository at this point in the history
…o request
  • Loading branch information
sksadjad committed May 25, 2024
1 parent 0267460 commit c49b237
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/oid4vci-holder/src/agent/OID4VCIHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, CredentialConfigSupport>
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
Expand Down

0 comments on commit c49b237

Please sign in to comment.