Skip to content

Commit

Permalink
[PresentationRequest] updated to only hv issuer creds if using the HV…
Browse files Browse the repository at this point in the history
… only flavor. (#27)
  • Loading branch information
rsmets authored Aug 16, 2022
1 parent 0909de5 commit 1667d32
Showing 1 changed file with 61 additions and 11 deletions.
72 changes: 61 additions & 11 deletions src/components/Authentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,11 @@ const Authentication: FC = () => {
const actuallyCreatePresentationRequest = async () => {
if (!session) return;

// customize these values for the specific demo (or not)
const credentialRequests: CredentialRequest[] = [
let credentialRequests: CredentialRequest[] = [
{
type: 'PhoneCredential',
required: false,
issuers: [config.proveIssuerDid]
}, {
type: 'DobCredential',
required: true,
issuers: [config.proveIssuerDid, config.hvIssuerDid]
}, {
type: 'SsnCredential',
required: false,
issuers: [config.proveIssuerDid]
issuers: [config.hvIssuerDid]
},
{
type: 'GenderCredential',
Expand Down Expand Up @@ -98,6 +89,65 @@ const Authentication: FC = () => {
}
];

// customize these values for the specific demo
if (config.proveEnabled) {
credentialRequests = [
{
type: 'PhoneCredential',
required: false,
issuers: [config.proveIssuerDid]
}, {
type: 'DobCredential',
required: true,
issuers: [config.proveIssuerDid, config.hvIssuerDid]
}, {
type: 'SsnCredential',
required: false,
issuers: [config.proveIssuerDid]
},
{
type: 'GenderCredential',
required: false,
issuers: [config.hvIssuerDid]
}, {
type: 'FullNameCredential',
required: false,
issuers: [config.hvIssuerDid]
}, {
type: 'AddressCredential',
required: false,
issuers: [config.hvIssuerDid]
},
{
type: 'CountryResidenceCredential',
required: false,
issuers: [config.hvIssuerDid]
}, {
type: 'GovernmentIdTypeCredential',
required: false,
issuers: [config.hvIssuerDid]
}, {
type: 'LivelinessCredential',
required: false,
issuers: [config.hvIssuerDid]
}, {
type: 'LivelinessConfidenceCredential',
required: false,
issuers: [config.hvIssuerDid]
},
{
type: 'FacialMatchCredential',
required: false,
issuers: [config.hvIssuerDid]
},
{
type: 'FacialMatchConfidenceCredential',
required: false,
issuers: [config.hvIssuerDid]
}
];
}

const presentationRequestOptions: DemoPresentationRequestCreateOptions = {
credentialRequests,
metadata: { fields: { sessionUuid: session.uuid } },
Expand Down

0 comments on commit 1667d32

Please sign in to comment.