mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 14:59:29 -07:00
Merge pull request 'Update proof verification JS to be case insensitive in more tests' (#7) from screenbeard/keyoxide:fingerprint-verification-fixes into dev
Reviewed-on: https://codeberg.org/yarmo/keyoxide/pulls/7
This commit is contained in:
commit
3362f8a071
2 changed files with 5 additions and 5 deletions
|
@ -361,7 +361,7 @@ async function verifyProof(url, fingerprint) {
|
|||
throw new Error('Response failed: ' + response.status);
|
||||
}
|
||||
json = await response.json();
|
||||
reVerify = new RegExp(`openpgp4fpr:${fingerprint}`);
|
||||
reVerify = new RegExp(`openpgp4fpr:${fingerprint}`, 'i');
|
||||
json.Answer.forEach((item, i) => {
|
||||
if (reVerify.test(item.data)) {
|
||||
output.isVerified = true;
|
||||
|
@ -413,7 +413,7 @@ async function verifyProof(url, fingerprint) {
|
|||
throw new Error('Response failed: ' + response.status);
|
||||
}
|
||||
json = await response.json();
|
||||
reVerify = new RegExp(`openpgp4fpr:${fingerprint}`);
|
||||
reVerify = new RegExp(`openpgp4fpr:${fingerprint}`, 'i');
|
||||
if (reVerify.test(json.about)) {
|
||||
output.isVerified = true;
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ async function verifyProof(url, fingerprint) {
|
|||
throw new Error('Response failed: ' + response.status);
|
||||
}
|
||||
json = await response.json();
|
||||
reVerify = new RegExp(`[Verifying my OpenPGP key: openpgp4fpr:${fingerprint}]`);
|
||||
reVerify = new RegExp(`[Verifying my OpenPGP key: openpgp4fpr:${fingerprint}]`, 'i');
|
||||
if (reVerify.test(json.files["openpgp.md"].content)) {
|
||||
output.isVerified = true;
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ async function verifyProof(url, fingerprint) {
|
|||
// Potentially Mastodon
|
||||
match = url.match(/https:\/\/(.*)\/@(.*)/);
|
||||
json.attachment.forEach((item, i) => {
|
||||
if (item.value === fingerprint) {
|
||||
if (item.value.toUpperCase() === fingerprint.toUpperCase()) {
|
||||
output.type = "mastodon";
|
||||
output.display = `@${match[2]}@${[match[1]]}`;
|
||||
output.proofUrlFetch = json.url;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<h3>Post a Reddit proof message</h3>
|
||||
|
||||
<p>Log in to <a href="https://www.reddit.com">www.reddit.com</a> and compose a new tweet with the following text (make sure to replace FINGERPRINT):</p>
|
||||
<p>Log in to <a href="https://www.reddit.com">www.reddit.com</a> and create a new post with the following text (make sure to replace FINGERPRINT):</p>
|
||||
<code>This is an OpenPGP proof that connects my OpenPGP key to this Reddit account.
|
||||
For details check out https://keyoxide.org/guides/openpgp-proofs
|
||||
<br><br>[Verifying my OpenPGP key: openpgp4fpr:FINGERPRINT]
|
||||
|
|
Loading…
Reference in a new issue