diff --git a/screens/Home/ViewVcModal.tsx b/screens/Home/ViewVcModal.tsx index a7cf6dfe..dd524fc1 100644 --- a/screens/Home/ViewVcModal.tsx +++ b/screens/Home/ViewVcModal.tsx @@ -74,7 +74,7 @@ export const ViewVcModal: React.FC = props => { useEffect(() => { getDetailedViewFields( - verifiableCredentialData.issuer as string, + verifiableCredentialData.vcMetadata.issuerHost as string, verifiableCredentialData.credentialConfigurationId, DETAIL_VIEW_DEFAULT_FIELDS, verifiableCredentialData.vcMetadata.format, diff --git a/screens/Request/ReceiveVcScreen.tsx b/screens/Request/ReceiveVcScreen.tsx index 47e2e6f8..ee0fdc51 100644 --- a/screens/Request/ReceiveVcScreen.tsx +++ b/screens/Request/ReceiveVcScreen.tsx @@ -42,7 +42,7 @@ export const ReceiveVcScreen: React.FC = () => { useEffect(() => { getDetailedViewFields( - verifiableCredentialData?.issuer, + verifiableCredentialData.vcMetadata.issuerHost, verifiableCredentialData.credentialConfigurationId, DETAIL_VIEW_DEFAULT_FIELDS, verifiableCredentialData.vcMetadata.format, diff --git a/shared/api.ts b/shared/api.ts index 7e6e8444..ac33ba24 100644 --- a/shared/api.ts +++ b/shared/api.ts @@ -177,13 +177,13 @@ export const CACHED_API = { }), fetchIssuerWellknownConfig: ( - issuerId: string, + issuerCacheKey: string, credentialIssuer: string, isCachePreferred: boolean = false, ) => generateCacheAPIFunction({ isCachePreferred, - cacheKey: API_CACHED_STORAGE_KEYS.fetchIssuerWellknownConfig(issuerId), + cacheKey: API_CACHED_STORAGE_KEYS.fetchIssuerWellknownConfig(issuerCacheKey), fetchCall: API.fetchIssuerWellknownConfig.bind(null, credentialIssuer), }), diff --git a/shared/openId4VCI/Utils.ts b/shared/openId4VCI/Utils.ts index 6caca326..d0485c1a 100644 --- a/shared/openId4VCI/Utils.ts +++ b/shared/openId4VCI/Utils.ts @@ -132,7 +132,7 @@ export const getDisplayObjectForCurrentLanguage = ( }; export const getCredentialIssuersWellKnownConfig = async ( - issuer: string | undefined, + issuerCacheKey: string | undefined, defaultFields: string[], credentialConfigurationId: string, format: string, @@ -142,7 +142,7 @@ export const getCredentialIssuersWellKnownConfig = async ( let wellknownFieldsFlag = false; let matchingWellknownDetails: any; const wellknownResponse = await CACHED_API.fetchIssuerWellknownConfig( - issuer!, + issuerCacheKey!, issuerHost, true, ); @@ -233,14 +233,14 @@ const flattenClaimPaths = ( export const getDetailedViewFields = async ( - issuer: string, + issuerCacheKey: string, credentialConfigurationId: string, defaultFields: string[], format: string, issuerHost: string, ) => { let response = await getCredentialIssuersWellKnownConfig( - issuer, + issuerCacheKey, defaultFields, credentialConfigurationId, format,