summaryrefslogtreecommitdiffstats
path: root/_includes
diff options
context:
space:
mode:
authorErny <erny@castellotti.net>2024-10-19 21:49:14 +0200
committerErny <erny@castellotti.net>2024-10-19 21:49:14 +0200
commitfff510b85223274822709ea6319f1aa2ec594f51 (patch)
treed70ba76041e767b189f047e62a0b1d963c22b905 /_includes
parentMerge pull request #368 from stich86/stich86-f6005v3 (diff)
downloadhack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar.gz
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar.bz2
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar.lz
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar.xz
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.tar.zst
hack-gpon.github.io-fff510b85223274822709ea6319f1aa2ec594f51.zip
Diffstat (limited to '_includes')
-rw-r--r--_includes/cig_password.html10
1 files changed, 4 insertions, 6 deletions
diff --git a/_includes/cig_password.html b/_includes/cig_password.html
index 33b24a5..5223e35 100644
--- a/_includes/cig_password.html
+++ b/_includes/cig_password.html
@@ -20,6 +20,8 @@
<label for="result" class="form-label">Password</label>
</div>
</form>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js"></script>
+ <script type="text/javascript" src="/assets/js/cigpassword.js"></script>
<script>
var cigPassword = document.getElementById('cig-password');
cigPassword.addEventListener('submit', (event) => {
@@ -27,12 +29,8 @@
if (!cigPassword.checkValidity()) {
event.preventDefault();
} else {
- const data = new URLSearchParams(new FormData(cigPassword));
- var url = new URL("https://cigpassword.hack-gpon.org/");
- url.search = data.toString();
- fetch(url, {mode: 'cors'}).then(response => response.json()).then(json => document.getElementById('result').value = json.password).catch((error) => {
- document.getElementById('result').value = "Error!"
- });
+ const data = new FormData(cigPassword);
+ document.getElementById('result').value = cigpassword_gpon(data.get("serial"), data.get("username"));
}
[...cigPassword.elements].map(e => e.parentNode).forEach(e => e.classList.toggle('was-validated', true));
});