Change the 'business logic' here

This commit is contained in:
swag 2023-06-14 20:17:07 -04:00
parent 0a2c198d1b
commit 62673f5aec

View File

@ -1,6 +1,13 @@
'use strict'; '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 let captchaValue = document
.querySelector('label[for="captcha"]') .querySelector('label[for="captcha"]')
.textContent .textContent
@ -8,13 +15,17 @@
let captchaForm = document let captchaForm = document
.querySelector('form[class="form-body"]'); .querySelector('form[class="form-body"]');
captchaForm.captcha.readOnly = true;
captchaForm.captcha.value = '⏳';
doCryptoStuff
.then(() => {
captchaForm.captcha.value = captchaValue; captchaForm.captcha.value = captchaValue;
// Make 'em work for it captchaForm.submit();
window.crypto.subtle.generateKey({ })
name: 'RSA-OAEP', .catch((err) => {
modulusLength: 4096, captchaForm.captcha.value = null;
publicExponent: new Uint8Array([1, 0, 1]), captchaForm.captcha.readOnly = false;
hash: 'SHA-512' console.log(err);
}, false, ['encrypt', 'decrypt']) });
.finally(() => captchaForm.submit());
})(); })();