web did resolver import cleanup
This commit is contained in:
parent
deb0e7302c
commit
cc18ea63a0
1 changed files with 3 additions and 5 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import type { DidDocument } from "@atcute/identity";
|
import type { DidDocument } from "@atcute/identity";
|
||||||
import type { WebDidDocumentResolver } from "@atcute/identity-resolver";
|
|
||||||
import type { ATProtoUniverse } from "@char/lexicon.ts/atproto";
|
import type { ATProtoUniverse } from "@char/lexicon.ts/atproto";
|
||||||
import { XRPC } from "@char/lexicon.ts/rpc";
|
import { XRPC } from "@char/lexicon.ts/rpc";
|
||||||
|
|
||||||
|
|
@ -20,11 +19,10 @@ export async function resolveDid(did: string): Promise<DidDocument> {
|
||||||
return doc;
|
return doc;
|
||||||
} else if (did.startsWith("did:web:")) {
|
} else if (did.startsWith("did:web:")) {
|
||||||
// TODO: write our own did:web resolver (maybe use a CORS proxy on clientside)
|
// TODO: write our own did:web resolver (maybe use a CORS proxy on clientside)
|
||||||
const resolver: WebDidDocumentResolver = await import(
|
const { WebDidDocumentResolver } = await import(
|
||||||
"@atcute/identity-resolver"
|
"@atcute/identity-resolver"
|
||||||
)
|
);
|
||||||
.then((m) => m.WebDidDocumentResolver)
|
const resolver = new WebDidDocumentResolver();
|
||||||
.then((r) => new r());
|
|
||||||
return resolver.resolve(did as `did:web:${string}`);
|
return resolver.resolve(did as `did:web:${string}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue