Skip to content

Commit

Permalink
Add credential verification
Browse files Browse the repository at this point in the history
  • Loading branch information
luistorres committed May 16, 2024
1 parent 623c42a commit 6c0ffb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/web-app/app/_server/idos/idos-grantee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,17 @@ export class idOSGrantee {
const credential = JSON.parse(credentialString);

const isValid = await this.isValidCredential(credential);
const isApproved = credential?.status === 'approved';

if (credential?.level && credential.level !== 'plus') {
console.log('Credential is not plus level, for dataId:', dataId);
}

if (credential?.level === 'plus' && isValid) {
if (!isApproved) {
console.log('Credential is not approved, for dataId:', dataId);
}

if (credential?.level === 'plus' && isValid && isApproved) {
return {
residentialCountry:
credential?.credentialSubject?.residential_address_country,
Expand Down

0 comments on commit 6c0ffb6

Please sign in to comment.