aboutsummaryrefslogtreecommitdiff
path: root/html/index.html
diff options
context:
space:
mode:
authorgrant-kun <[email protected]>2022-10-14 09:42:29 -0500
committergrant-kun <[email protected]>2022-10-14 09:42:29 -0500
commit37be2226d68a27dd908a17770d93443d0d782c9f (patch)
treea8ec1dfc87e85cf3e2a73e66852e914ed1878eea /html/index.html
parent26d50b8e63f79e48652840a54567b059d1f73766 (diff)
deleting and less logging
Diffstat (limited to 'html/index.html')
-rw-r--r--html/index.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/html/index.html b/html/index.html
index f28a971..04d4c9f 100644
--- a/html/index.html
+++ b/html/index.html
@@ -123,7 +123,7 @@
var xhr = new XMLHttpRequest();
xhr.open("POST", window.location.href + 'login/submit', true);
xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.onreadystatechange = function () {
+ xhr.onreadystatechange = async function () {
if (xhr.readyState == XMLHttpRequest.DONE) {
let dec = (kekw.decrypt(JSON.parse(xhr.responseText).data));
if (JSON.parse(xhr.responseText).html) {
@@ -132,7 +132,10 @@
if (JSON.parse(xhr.responseText).json && JSON.parse(xhr.responseText).type == 'key') {
let decc = new TextDecoder().decode(dec)
//console.log(JSON.parse(decc))
- setCookie('login_key', JSON.parse(decc).login_key, 7)
+ let u = await document.getElementById('user').value
+ await setCookie('login_key', JSON.parse(decc).login_key, 7)
+ await setCookie('user', u, 7)
+ location.href = location.href + 'home'
}
}
}