From 697906c9535d6fcaba2d105548c2f90a8fb40bcd Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 8 Oct 2023 03:01:39 -0400 Subject: [PATCH] iteration --- auth_server.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/auth_server.lua b/auth_server.lua index cc658f8..9b41fe7 100644 --- a/auth_server.lua +++ b/auth_server.lua @@ -109,13 +109,17 @@ while true do rednet.send(client_id, "invalid request", "auth") else + local found = false for user, userdata in pairs(data.users) do if userdata.token == request.token then rednet.send(client_id, user, "auth") + found = true end end - rednet.send(client_id, "invalid token", "auth") + if not found then + rednet.send(client_id, "invalid token", "auth") + end end end