mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2025-01-10 15:19:28 -07:00
Merge pull request '44-redit-proof-fix' (#45) from yisraeldov/keyoxide-web:44-redit-proof-fix into dev
Reviewed-on: https://codeberg.org/keyoxide/web/pulls/45
This commit is contained in:
commit
eb0e86bdcb
1 changed files with 302 additions and 298 deletions
|
@ -435,6 +435,7 @@ async function verifyProof(url, fingerprint) {
|
|||
// Init
|
||||
let reVerify, match, output = {url: url, type: null, proofUrl: url, proofUrlFetch: null, isVerified: false, display: null, qr: null};
|
||||
|
||||
try {
|
||||
// DNS
|
||||
if (/^dns:/.test(url)) {
|
||||
output.type = "domain";
|
||||
|
@ -579,7 +580,7 @@ async function verifyProof(url, fingerprint) {
|
|||
// Reddit
|
||||
if (/^https:\/\/(?:www\.)?reddit\.com\/user/.test(url)) {
|
||||
output.type = "reddit";
|
||||
match = url.match(/https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\//);
|
||||
match = url.match(/https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/([^/]*)/);
|
||||
output.display = match[1];
|
||||
output.url = `https://www.reddit.com/user/${match[1]}`;
|
||||
output.proofUrl = `https://www.reddit.com/user/${match[1]}/comments/${match[2]}.json`;
|
||||
|
@ -791,6 +792,9 @@ async function verifyProof(url, fingerprint) {
|
|||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
|
||||
// Return output without confirmed proof
|
||||
return output;
|
||||
|
|
Loading…
Reference in a new issue