From f9ae7618c9e22065b8b23f6afa4fb1945663911a Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 8 Oct 2023 05:07:48 -0400 Subject: [PATCH] iteration --- packages/auth_server.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/auth_server.lua b/packages/auth_server.lua index dc4d234..2679ecc 100644 --- a/packages/auth_server.lua +++ b/packages/auth_server.lua @@ -77,12 +77,11 @@ while true do password = convert_password(request.password) } - -- if only user in database, add to admin group - log(table.getn(data.users)) - if table.getn(data.users) == 0 then - log("Adding " .. request.username .. " to admin group") - data.users[request.username].groups = {} - data.users[request.username].groups["admin"] = true + local user_count = #data.users + if user_count == 1 then + data.users[request.username].groups = { + ["admin"] = true + } end save_data()