parent
0b7509d6ee
commit
1cff4f3cf1
|
@ -3,6 +3,3 @@
|
||||||
< css/elements.css
|
< css/elements.css
|
||||||
< css/simple.css
|
< css/simple.css
|
||||||
< css/nested.css
|
< css/nested.css
|
||||||
|
|
||||||
! app.js
|
|
||||||
< js/captcha.js
|
|
||||||
|
|
|
@ -1,20 +1,13 @@
|
||||||
|
/*
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(() => {
|
document.getElementById('captcha').value =
|
||||||
let captchaValue = document
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
let captchaValue =
|
||||||
|
document
|
||||||
.querySelector('label[for="captcha"]')
|
.querySelector('label[for="captcha"]')
|
||||||
.textContent
|
.textContent
|
||||||
.match(/'(flag|bump)'/)[1];
|
.match(/'(flag|bump)'/)[1];
|
||||||
let captchaForm = document
|
|
||||||
.querySelector('form[class="form-body"]');
|
|
||||||
|
|
||||||
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());
|
|
||||||
})();
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
<%= asset 'app.js' %>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
<%= label_for captcha => "Enter the word 'bump' to confirm:" %>
|
<%= label_for captcha => "Enter the word 'bump' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
<%= asset 'app.js' %>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
<%= asset 'app.js' %>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user