diff --git a/auth_server.lua b/auth_server.lua index 72ff545..cf356d1 100644 --- a/auth_server.lua +++ b/auth_server.lua @@ -106,20 +106,17 @@ while true do if request.action == "token" then if request.token == nil or request.token == "" or request.token == -1 then rednet.send(client_id, "invalid request", "auth") - log("Token request from " .. client_id .. " denied (invalid request)") else local found = false for user, userdata in pairs(data.users) do if userdata.token == request.token then - log("Token request from " .. client_id .. " granted for " .. user) rednet.send(client_id, user, "auth") found = true end end if not found then - log("Token request from " .. client_id .. " denied (invalid token)") rednet.send(client_id, "invalid token", "auth") end end diff --git a/lns_server.lua b/lns_server.lua index 8a6dce7..db1f803 100644 --- a/lns_server.lua +++ b/lns_server.lua @@ -117,8 +117,11 @@ while true do ["token"] = request.token }, "auth") - authID, auth_response = rednet.receive("auth") - log_debug("Auth response: " .. auth_response) + local responseServerID = nil + while responseServerID ~= authID do + responseServerID, auth_response = rednet.receive("auth") + end + local errorPos, errorEnd = string.find(auth_response, "invalid") if errorPos then log("Error: " .. auth_response)