atproto explorer

fix handle resolution

handle.invalid 2e07016d f8898e18

verified
+8 -14
+1 -1
src/components/navbar.tsx
··· 43 43 didDocCache[props.params.repo]?.alsoKnownAs 44 44 ?.filter((alias) => alias.startsWith("at://"))[0] 45 45 .split("at://")[1] ?? props.params.repo; 46 - if (hdl !== handle()) { 46 + if (hdl !== handle() || validHandle() === undefined) { 47 47 setValidHandle(undefined); 48 48 setHandle(hdl); 49 49 setValidHandle(await validateHandle(hdl as Handle, props.params.repo as Did));
+6 -11
src/utils/api.ts
··· 12 12 DohJsonHandleResolver, 13 13 PlcDidDocumentResolver, 14 14 WellKnownHandleResolver, 15 - XrpcHandleResolver, 16 15 } from "@atcute/identity-resolver"; 17 16 import { Did, Handle } from "@atcute/lexicons"; 18 17 import { isHandle } from "@atcute/lexicons/syntax"; ··· 28 27 }, 29 28 }); 30 29 31 - const handleResolver = new XrpcHandleResolver({ 32 - serviceUrl: "https://public.api.bsky.app", 30 + const handleResolver = new CompositeHandleResolver({ 31 + strategy: "dns-first", 32 + methods: { 33 + dns: new DohJsonHandleResolver({ dohUrl: "https://dns.google/resolve?" }), 34 + http: new WellKnownHandleResolver(), 35 + }, 33 36 }); 34 37 35 38 const didPDSCache: Record<string, string> = {}; ··· 76 79 77 80 const validateHandle = async (handle: Handle, did: Did) => { 78 81 if (!isHandle(handle)) return false; 79 - 80 - const handleResolver = new CompositeHandleResolver({ 81 - strategy: "dns-first", 82 - methods: { 83 - dns: new DohJsonHandleResolver({ dohUrl: "https://dns.google/resolve?" }), 84 - http: new WellKnownHandleResolver(), 85 - }, 86 - }); 87 82 88 83 let resolvedDid: string; 89 84 try {
+1 -2
src/views/repo.tsx
··· 8 8 } from "@atcute/did-plc"; 9 9 import { DidDocument } from "@atcute/identity"; 10 10 import { ActorIdentifier, Handle } from "@atcute/lexicons"; 11 - import { resolveHandle } from "@atcute/oauth-browser-client"; 12 11 import { A, useLocation, useNavigate, useParams } from "@solidjs/router"; 13 12 import { createResource, createSignal, ErrorBoundary, For, Show, Suspense } from "solid-js"; 14 13 import { Backlinks } from "../components/backlinks.jsx"; 15 14 import { Button } from "../components/button.jsx"; 16 15 import { TextInput } from "../components/text-input.jsx"; 17 16 import Tooltip from "../components/tooltip.jsx"; 18 - import { didDocCache, resolvePDS } from "../utils/api.js"; 17 + import { didDocCache, resolveHandle, resolvePDS } from "../utils/api.js"; 19 18 import { localDateFromTimestamp } from "../utils/date.js"; 20 19 import { createOperationHistory, DiffEntry, groupBy } from "../utils/plc-logs.js"; 21 20 import { BlobView } from "./blob.jsx";