mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
fix: handle doip promise rejection
This commit is contained in:
parent
44f9664300
commit
1373f14587
1 changed files with 10 additions and 1 deletions
|
@ -102,7 +102,16 @@ const fetchWKD = (id) => {
|
||||||
reject(new Error('No public keys could be read from the data fetched using WKD'))
|
reject(new Error('No public keys could be read from the data fetched using WKD'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
profile = await doipjs.openpgp.parsePublicKey(publicKey)
|
profile = await doipjs.openpgp.parsePublicKey(publicKey)
|
||||||
|
} catch (error) {
|
||||||
|
profile = null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!profile) {
|
||||||
|
reject(new Error('No public keys could be fetched using WKD'))
|
||||||
|
return
|
||||||
|
}
|
||||||
profile.publicKey.fetch.method = 'wkd'
|
profile.publicKey.fetch.method = 'wkd'
|
||||||
profile.publicKey.fetch.query = id
|
profile.publicKey.fetch.query = id
|
||||||
profile.publicKey.fetch.resolvedUrl = fetchURL
|
profile.publicKey.fetch.resolvedUrl = fetchURL
|
||||||
|
|
Loading…
Reference in a new issue