diff --git a/packages/lns_server.lua b/packages/lns_server.lua index db1f803..967098b 100644 --- a/packages/lns_server.lua +++ b/packages/lns_server.lua @@ -19,6 +19,13 @@ settings.define("lns_server.require_auth", { }) require_auth = settings.get("lns_server.require_auth") +settings.define("lns_server.auth_group", { + description = "Authentication group", + type = "string", + default = "admin" +}) +local auth_group = settings.get("lns_server.auth_group") + settings.define("lns_server.auth_server", { description = "Authentication server", type = "string", @@ -126,7 +133,11 @@ while true do if errorPos then log("Error: " .. auth_response) else - auth_passed = true + if auth.check_user_in_group(auth_response, auth_group) then + auth_passed = true + else + rednet.send(client_id, "invalid auth", "lns") + end end else log("Error: Auth server not found to " .. client_id)