summaryrefslogtreecommitdiff
path: root/src/login_cram.js
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:32:12 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:32:12 +0100
commit6fe35cbd50d318bed8d12c5d9fc2602f8936f883 (patch)
tree6b9c9f891552a1beacdc11f646b7dd9000d46021 /src/login_cram.js
parent35c4aba3471691685592547300ca5bb588adeb53 (diff)
Switched from CDN to a npm+bundler for css framework
and crypto-js
Diffstat (limited to 'src/login_cram.js')
-rw-r--r--src/login_cram.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/login_cram.js b/src/login_cram.js
new file mode 100644
index 0000000..7faa646
--- /dev/null
+++ b/src/login_cram.js
@@ -0,0 +1,9 @@
+import HmacMD5 from 'crypto-js/hmac-md5';
+
+document.login1.submit_button.disabled = false;
+
+document.forms.login1.addEventListener("formdata", (form_data_evt) => {
+ const form_data = form_data_evt.formData;
+ const res = HmacMD5(form_data.get("challenge"), form_data.get("password"));
+ form_data.set("password", res);
+});