1
0
Fork 1
mirror of https://codeberg.org/keyoxide/doipjs.git synced 2025-01-10 06:39:27 -07:00

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) {
case 'Note': {
claimData.profile.uri = proofData.result.attributedTo
claimData.profile.display = proofData.result.attributedTo
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
}