Skip to content

Commit

Permalink
fix: Fix some issues with did:key resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Oct 1, 2023
1 parent 61cff08 commit e37c232
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/did/DIDResolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export function mergeAllDidMethods(subjectSyntaxTypesSupported: string | string[
}

export async function resolveDidDocument(did: string, opts?: ResolveOpts): Promise<DIDDocument> {
const result = await getResolver(opts).resolve(did);
// todo: The accept is only there because did:key used by Veramo requires it. According to the spec it is optional. It should not hurt, but let's test
const result = await getResolver({ ...opts }).resolve(did, { accept: 'application/did+ld+json' });
if (result?.didResolutionMetadata?.error) {
throw Error(result.didResolutionMetadata.error);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (!result.didDocument && result.id) {
Expand Down

0 comments on commit e37c232

Please sign in to comment.