Skip to content

Commit cb200b7

Browse files
committed
fix: Fixed an issue with delegate verification
1 parent 2ab08bf commit cb200b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/resolver/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export const OrgIdResolver = (options: ResolverOptions): OrgIdResolverAPI => {
275275
level: number
276276
): Promise<VerificationMethodPublicKey> => {
277277

278-
const { did } = parsers.parseDid(verificationMethodId);
278+
const { orgId: verificationMethodDid } = parsers.parseDid(verificationMethodId);
279279
const parentDid = object.getDeepValue(
280280
parentOrgJsonVc,
281281
'credentialSubject.id'
@@ -284,7 +284,7 @@ export const OrgIdResolver = (options: ResolverOptions): OrgIdResolverAPI => {
284284
let verificationMethodResolution: DidResolutionResponse;
285285
let delegateVerificationMethodDefinition: VerificationMethodReference[];
286286

287-
if (did !== parentDid) {
287+
if (verificationMethodDid !== parentDid) {
288288
// Resolve external verificationMethodId
289289
verificationMethodResolution = await resolve(
290290
verificationMethodId,
@@ -320,9 +320,9 @@ export const OrgIdResolver = (options: ResolverOptions): OrgIdResolverAPI => {
320320
throw new Error('Unable to get verificationMethods of delegate');
321321
}
322322

323-
const verificationMethod = delegateVerificationMethodDefinition.filter(
323+
const verificationMethod = delegateVerificationMethodDefinition.find(
324324
v => v.id === verificationMethodId
325-
)[0];
325+
);
326326

327327
if (!verificationMethod) {
328328
throw new Error('Unable to get verificationMethod of delegate');

0 commit comments

Comments
 (0)