Skip to content

Commit

Permalink
fix: Fix for when credential_configuration_ids is being used together…
Browse files Browse the repository at this point in the history
… with credentials_supported
  • Loading branch information
nklomp committed Aug 22, 2024
1 parent 282e7a1 commit c9ff2fc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function getSupportedCredential(opts?: {

let credentialConfigurationsV11: Array<CredentialConfigurationSupported> | undefined = undefined;
let credentialConfigurationsV13: Record<string, CredentialConfigurationSupportedV1_0_13> | undefined = undefined;
if (version < OpenId4VCIVersion.VER_1_0_12 || issuerMetadata?.credentials_supported) {
if (version < OpenId4VCIVersion.VER_1_0_12 || (issuerMetadata?.credential_configurations_supported === undefined && issuerMetadata?.credentials_supported)) {
if (issuerMetadata?.credentials_supported && !Array.isArray(issuerMetadata?.credentials_supported)) {
// The current code duplication and logic is such a mess, that we re-adjust the object to the proper type again
credentialConfigurationsV11 = [];
Expand Down

0 comments on commit c9ff2fc

Please sign in to comment.