File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ function isOpenIdCredentialDetail(ad: AuthorizationDetails): ad is Authorization
7676 return typeof ad === 'object' && ad !== null && ad . type === 'openid_credential'
7777}
7878
79- // Update the helper function:
8079function findAuthorizationDetail (
8180 authorizationDetails : AuthorizationDetails [ ] | undefined ,
8281 preferredConfigId ?: string
@@ -93,10 +92,20 @@ function findAuthorizationDetail(
9392
9493 // If a preferred config ID is specified, try to find a match
9594 if ( preferredConfigId ) {
96- const match = openIdCredentialDetails . find ( detail =>
97- typeof detail === 'object' && detail !== null &&
98- ( detail as any ) . credential_configuration_id === preferredConfigId
99- )
95+ const match = openIdCredentialDetails . find ( detail => {
96+ if ( typeof detail !== 'object' || detail === null ) return false
97+
98+ const detailObj = detail as any
99+
100+ if ( detailObj . credential_configuration_id === preferredConfigId ) {
101+ return true
102+ }
103+ if ( detailObj . credential_identifier === preferredConfigId ) {
104+ return true
105+ }
106+ return Array . isArray ( detailObj . credential_identifiers ) && detailObj . credential_identifiers . includes ( preferredConfigId )
107+ } )
108+
100109 if ( match ) {
101110 return match
102111 }
You can’t perform that action at this time.
0 commit comments