From 459fce85ac1ab5a18751859ba47fb2ea060a6e81 Mon Sep 17 00:00:00 2001 From: swag Date: Sat, 17 Jun 2023 16:47:03 -0400 Subject: [PATCH] Revert "Change the 'business logic' here" This reverts commit 62673f5aec214d1e2ffa88ff2f6a2003c23ea493. --- assets/js/captcha.js | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/assets/js/captcha.js b/assets/js/captcha.js index b9be7e4..8fd0ace 100644 --- a/assets/js/captcha.js +++ b/assets/js/captcha.js @@ -1,13 +1,6 @@ 'use strict'; (() => { - // Make 'em work for it! - let doCryptoStuff = window.crypto.subtle.generateKey({ - name: 'RSA-OAEP', - modulusLength: 4096, - publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-512' - }, false, ['encrypt', 'decrypt']); let captchaValue = document .querySelector('label[for="captcha"]') .textContent @@ -15,17 +8,13 @@ let captchaForm = document .querySelector('form[class="form-body"]'); - captchaForm.captcha.readOnly = true; - captchaForm.captcha.value = '⏳'; - - doCryptoStuff - .then(() => { - captchaForm.captcha.value = captchaValue; - captchaForm.submit(); - }) - .catch((err) => { - captchaForm.captcha.value = null; - captchaForm.captcha.readOnly = false; - console.log(err); - }); + captchaForm.captcha.value = captchaValue; + // Make 'em work for it + window.crypto.subtle.generateKey({ + name: 'RSA-OAEP', + modulusLength: 4096, + publicExponent: new Uint8Array([1, 0, 1]), + hash: 'SHA-512' + }, false, ['encrypt', 'decrypt']) + .finally(() => captchaForm.submit()); })();