iteration

This commit is contained in:
Layla 2023-10-08 03:01:39 -04:00
parent 2128066f14
commit 697906c953

View File

@ -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