fixed captcha more and better errors

This commit is contained in:
MathMan05 2024-07-28 16:07:21 -05:00
parent 3621f1b09b
commit f10ea4ac2a
7 changed files with 197 additions and 52 deletions

View file

@ -175,13 +175,19 @@ async function login(username, password, captcha) {
console.log(response);
if (response.captcha_sitekey) {
const capt = document.getElementById("h-captcha");
const capty = document.createElement("div");
capty.classList.add("h-captcha");
capty.setAttribute("data-sitekey", response.captcha_sitekey);
const script = document.createElement("script");
script.src = "https://js.hcaptcha.com/1/api.js";
capt.append(script);
capt.append(capty);
if (!capt.children.length) {
const capty = document.createElement("div");
capty.classList.add("h-captcha");
capty.setAttribute("data-sitekey", response.captcha_sitekey);
const script = document.createElement("script");
script.src = "https://js.hcaptcha.com/1/api.js";
capt.append(script);
capt.append(capty);
}
else {
eval("hcaptcha.reset()");
}
return;
}
else {
adduser({ serverurls: JSON.parse(localStorage.getItem("instanceinfo")), email: username, token: response.token });