Revert "Change the 'business logic' here"
This reverts commit 62673f5aec
.
This commit is contained in:
parent
b4bcf613dd
commit
459fce85ac
|
@ -1,13 +1,6 @@
|
||||||
'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
|
||||||
|
@ -15,17 +8,13 @@
|
||||||
let captchaForm = document
|
let captchaForm = document
|
||||||
.querySelector('form[class="form-body"]');
|
.querySelector('form[class="form-body"]');
|
||||||
|
|
||||||
captchaForm.captcha.readOnly = true;
|
captchaForm.captcha.value = captchaValue;
|
||||||
captchaForm.captcha.value = '⏳';
|
// Make 'em work for it
|
||||||
|
window.crypto.subtle.generateKey({
|
||||||
doCryptoStuff
|
name: 'RSA-OAEP',
|
||||||
.then(() => {
|
modulusLength: 4096,
|
||||||
captchaForm.captcha.value = captchaValue;
|
publicExponent: new Uint8Array([1, 0, 1]),
|
||||||
captchaForm.submit();
|
hash: 'SHA-512'
|
||||||
})
|
}, false, ['encrypt', 'decrypt'])
|
||||||
.catch((err) => {
|
.finally(() => captchaForm.submit());
|
||||||
captchaForm.captcha.value = null;
|
|
||||||
captchaForm.captcha.readOnly = false;
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user