ai-adventure-labs/server/frontend/public/js/connect/auth.js
2025-03-21 23:45:02 +03:00

20 lines
544 B
JavaScript

export class ServerAuth {
constructor (address, port, tlsEnabled) {
this.address = address;
this.port = port;
this.isTLSenabled = !!tlsEnabled;
}
getAuth () {
const serverdata = JSON.parse(localStorage.getItem(`server:${
!!this.isTLSenabled ? "wss" : "ws"
}:${address}:${port}`) ?? "null");
if (!serverdata) return null;
}
}
ServerAuth.authForm = document.createElement("div");
["auth-window"].forEach(c =>
ServerAuth.authForm.classList.add(c));
ServerAuth.authForm.innerHTML = `<center><h1>Log-In</h1></center><hr/>`;