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()