feature: fetch public key from notaryUrl in proof on shared proofs

This commit is contained in:
Tanner Shaw
2024-03-21 10:11:09 -07:00
parent 45322e33cc
commit 9ef42e2c41
2 changed files with 10 additions and 3 deletions

View File

@@ -27,8 +27,15 @@ export default function SharedProof(): ReactElement {
}
const data = await response.json();
try {
const proof = await verify(data, notaryKey);
console.log(data);
let pubKey;
if (data.notaryUrl) {
const notaryFetch = await fetch(data.notaryUrl + '/info');
const notaryData = await notaryFetch.json();
pubKey = notaryData.publicKey;
}
const proof = await verify(data, pubKey || notaryKey);
setVerifiedProof(proof);
} catch (e) {

View File

@@ -25,7 +25,7 @@ type State = {
}
const initState: State = {
key: keys.defaultKey
key: keys.notaryPseKey
}