diff --git a/assets/scripts.js b/assets/scripts.js index 55c06c7..daa47ae 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -493,9 +493,25 @@ async function verifyProof(url, fingerprint) { output.isVerified = true; } } catch (e) { - } finally { - return output; } + + if(output.isVerified == false) { + output.proofUrlFetch = `/server/verifyHackerNews.php?user=${match[1]}&fp=${fingerprint}`; + try { + response = await fetch(output.proofUrlFetch, { + headers: { + Accept: 'application/json' + }, + credentials: 'omit' + }); + if (!response.ok) { + throw new Error('Response failed: ' + response.status); + } + json = await response.json(); + output.isVerified = json.verified; + } catch (e) { } + } + return output; } // dev.to if (/^https:\/\/dev\.to\//.test(url)) { diff --git a/server/verifyHackerNews.php b/server/verifyHackerNews.php new file mode 100644 index 0000000..bfa9089 --- /dev/null +++ b/server/verifyHackerNews.php @@ -0,0 +1,28 @@ +