@sphereon/ssi-sdk.oid4vci-holder 0.34.1-next.5 → 0.34.1-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2737,9 +2737,19 @@ var OID4VCIHolder = class _OID4VCIHolder {
2737
2737
  }
2738
2738
  let counter = 0;
2739
2739
  for (const credentialId of selectedCredentials) {
2740
- const localeBranding = credentialBranding?.[credentialId];
2740
+ const configId = credentialId;
2741
+ const types = credentialsToAccept.find((ac) => ac.correlationId === configId || ac.credentialToAccept.id === configId || ac.types.includes(configId))?.types?.filter((type) => type != "VerifiableCredential") ?? [];
2742
+ const localeBranding = credentialBranding?.[configId] ?? [];
2743
+ if (localeBranding.length === 0) {
2744
+ for (const type of types) {
2745
+ const branding = credentialBranding?.[type] ?? [];
2746
+ if (branding.length > 0) {
2747
+ localeBranding.push(...branding);
2748
+ }
2749
+ }
2750
+ }
2741
2751
  if (localeBranding && localeBranding.length > 0) {
2742
- const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || credentialsToAccept[counter]);
2752
+ const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || JSON.stringify(credAccept.types.filter((cred) => cred !== "VerifiableCredential")) === JSON.stringify(types) || credentialsToAccept[counter]);
2743
2753
  counter++;
2744
2754
  await context.agent.ibAddCredentialBranding({
2745
2755
  vcHash: (0, import_utils2.computeEntryHash)(credential.rawVerifiableCredential),