diff --git a/src/resolver.ts b/src/resolver.ts index c099dc2..20090eb 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -32,9 +32,20 @@ export function getResolver(): Record { if (!didDocument[0]) { throw new Error(`The DID document for the given DID was not found!`) } + const didDocumentJson = JSON.parse(didDocument[0]) + if (!didDocumentJson?.verificationMethod) { + return { + didDocument: didDocumentJson, + didDocumentMetadata: { + linkedResourceMetadata: [], + deactivated: true, + }, + didResolutionMetadata: { contentType: 'application/did+ld+json' }, + } + } return { - didDocument: JSON.parse(didDocument[0]), + didDocument: didDocumentJson, didDocumentMetadata: { linkedResourceMetadata: didDocument[1].map((element: string) => { return JSON.parse(element)