mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 14:59:29 -07:00
fix: use correct fromJSON() for Profiles and Claims
This commit is contained in:
parent
7ce2287894
commit
fc10aeba1c
2 changed files with 6 additions and 4 deletions
|
@ -58,7 +58,8 @@ const fetchWKD = (id) => {
|
|||
|
||||
const hash = createHash('md5').update(id).digest('hex')
|
||||
if (c && await c.get(hash)) {
|
||||
profile = doipjs.Claim.fromJson(JSON.parse(await c.get(hash)))
|
||||
profile = doipjs.Profile.fromJSON(JSON.parse(await c.get(hash)))
|
||||
return resolve(profile)
|
||||
}
|
||||
|
||||
if (!profile) {
|
||||
|
@ -147,7 +148,8 @@ const fetchHKP = (id, keyserverDomain) => {
|
|||
const hash = createHash('md5').update(`${query}__${keyserverDomainNormalized}`).digest('hex')
|
||||
|
||||
if (c && await c.get(hash)) {
|
||||
profile = doipjs.Claim.fromJson(JSON.parse(await c.get(hash)))
|
||||
profile = doipjs.Profile.fromJSON(JSON.parse(await c.get(hash)))
|
||||
return resolve(profile)
|
||||
}
|
||||
|
||||
if (!profile) {
|
||||
|
|
|
@ -45,7 +45,7 @@ export class Claim extends HTMLElement {
|
|||
}
|
||||
|
||||
async verify() {
|
||||
const claim = doipjs.Claim.fromJson(JSON.parse(this.getAttribute('data-claim')));
|
||||
const claim = doipjs.Claim.fromJSON(JSON.parse(this.getAttribute('data-claim')));
|
||||
await claim.verify({
|
||||
proxy: {
|
||||
policy: 'adaptive',
|
||||
|
@ -59,7 +59,7 @@ export class Claim extends HTMLElement {
|
|||
updateContent(value) {
|
||||
const root = this;
|
||||
const claimJson = JSON.parse(value);
|
||||
const claim = doipjs.Claim.fromJson(claimJson);
|
||||
const claim = doipjs.Claim.fromJSON(claimJson);
|
||||
|
||||
root.querySelector('.info .title').innerText = claimJson.display.name;
|
||||
root.querySelector('.info .subtitle').innerText = claimJson.display.serviceProviderName ??
|
||||
|
|
Loading…
Reference in a new issue