iteration
This commit is contained in:
parent
6aeedb89a6
commit
8c3feb5233
@ -19,6 +19,13 @@ settings.define("lns_server.require_auth", {
|
|||||||
})
|
})
|
||||||
require_auth = settings.get("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", {
|
settings.define("lns_server.auth_server", {
|
||||||
description = "Authentication server",
|
description = "Authentication server",
|
||||||
type = "string",
|
type = "string",
|
||||||
@ -126,7 +133,11 @@ while true do
|
|||||||
if errorPos then
|
if errorPos then
|
||||||
log("Error: " .. auth_response)
|
log("Error: " .. auth_response)
|
||||||
else
|
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
|
end
|
||||||
else
|
else
|
||||||
log("Error: Auth server not found to " .. client_id)
|
log("Error: Auth server not found to " .. client_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user