diff options
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/cig_password.html | 10 |
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)); }); |