fix: allow the activitypub Person request to fail

This commit is contained in:
Yarmo Mackenbach 2023-09-19 15:15:53 +02:00
parent feda782136
commit 1baffe9c92
No known key found for this signature in database
GPG key ID: 3C57D093219103A3

View file

@ -81,8 +81,12 @@ export const functions = {
switch (proofData.result.type) { switch (proofData.result.type) {
case 'Note': { case 'Note': {
claimData.profile.uri = proofData.result.attributedTo claimData.profile.uri = proofData.result.attributedTo
claimData.profile.display = proofData.result.attributedTo
const personData = await fetcher.activitypub.fn({ url: proofData.result.attributedTo }, opts) const personData = await fetcher.activitypub.fn({ url: proofData.result.attributedTo }, opts)
claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}` .catch(_ => null)
if (personData) {
claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}`
}
break break
} }