From 37be2226d68a27dd908a17770d93443d0d782c9f Mon Sep 17 00:00:00 2001 From: grant-kun Date: Fri, 14 Oct 2022 09:42:29 -0500 Subject: deleting and less logging --- html/index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'html/index.html') 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' } } } -- cgit v1.2.3