Skip to content

Commit

Permalink
Merge pull request #87 from 0xPolygonID/fix/empty-subject
Browse files Browse the repository at this point in the history
fix case with empty credential subject
  • Loading branch information
vmidyllic authored Jun 30, 2023
2 parents 63c6ddc + cfac776 commit be0b7bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/proof/proof-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ export class ProofService implements IProofService {
}

let path: Path = new Path();
if (parsedQuery.query.operator !== QueryOperators.$noop) {
if (!!parsedQuery.fieldName) {
path = await Path.getContextPathKey(
JSON.stringify(schema),
credential.type[1],
Expand All @@ -665,6 +665,12 @@ export class ProofService implements IProofService {
} else {
parsedQuery.query.slotIndex = 5; // value data slot b
}
if (!parsedQuery.fieldName){
const resultQuery = parsedQuery.query;
resultQuery.operator = QueryOperators.$eq;
resultQuery.values = [mtEntry];
return { query: resultQuery };
}
if (parsedQuery.isSelectiveDisclosure) {
const rawValue = mk.rawValue(path);
const vp = createVerifiablePresentation(
Expand Down Expand Up @@ -725,7 +731,7 @@ export class ProofService implements IProofService {
private async parseRequest(req?: { [key: string]: unknown }): Promise<QueryWithFieldName> {
if (!req) {
const query = new Query();
query.operator = QueryOperators.$noop;
query.operator = QueryOperators.$eq;
return { query, fieldName: '' };
}

Expand Down

0 comments on commit be0b7bd

Please sign in to comment.