reject logins before user connects to node

This commit is contained in:
Elijah R
2024-04-08 19:23:44 -04:00
committed by Elijah R
parent 0821ac89e8
commit 0c3d482e82
+4
View File
@@ -249,6 +249,10 @@ export default class WSServer {
switch (msgArr[0]) {
case "login":
if (msgArr.length !== 2 || !this.Config.auth.enabled) return;
if (!client.connectedToNode) {
client.sendMsg(guacutils.encode("login", "0", "You must connect to the VM before logging in."));
return;
}
var res = await this.auth!.Authenticate(msgArr[1], client);
if (res.clientSuccess) {
log("INFO", `${client.IP.address} logged in as ${res.username}`);