mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
fix: allow the activitypub Person request to fail
This commit is contained in:
parent
feda782136
commit
1baffe9c92
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||||
|
.catch(_ => null)
|
||||||
|
if (personData) {
|
||||||
claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}`
|
claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}`
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue