Skip to content

Commit

Permalink
chore: more adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyAfternoons committed Jan 9, 2025
1 parent 90afb06 commit b39cfad
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/credential/issuance/03-start-user-authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ const selectCredentialDefinition = (
const credential_configurations_supported =
issuerConf.openid_credential_issuer.credential_configurations_supported;

const [result] = Object.keys(credential_configurations_supported)
.filter((e) => e.includes(credentialType))
const [result] = credential_configurations_supported
.filter((e) => e.credential_definition.type.includes(credentialType))
.map((e) => ({
credential_configuration_id: credentialType,
format: credential_configurations_supported[e]!.format,
format: e.format,
type: "openid_credential" as const,
}));

console.log(JSON.stringify(result));

if (!result) {
throw new Error(`No credential support the type '${credentialType}'`);
}
Expand Down Expand Up @@ -106,7 +108,9 @@ export const startUserAuthorization: StartUserAuthorization = async (
issuerConf,
credentialType
);
const responseMode = selectResponseMode(issuerConf, credentialType);
const responseMode = selectResponseMode(credentialType);

console.log(responseMode);

const getPar = makeParRequest({ wiaCryptoContext, appFetch });
const issuerRequestUri = await getPar(
Expand Down

0 comments on commit b39cfad

Please sign in to comment.