From a7761faf62aa637599c610e3e99df1b405b94d6d Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 8 Oct 2023 02:57:56 -0400 Subject: [PATCH] iteration --- auth.lua | 4 ++-- auth_server.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auth.lua b/auth.lua index ae41c95..3bab1c5 100644 --- a/auth.lua +++ b/auth.lua @@ -10,7 +10,7 @@ local action = args[1] settings.define("auth.token", { description = "Authentication token", type = "number", - default = "" + default = -1 }) settings.define("auth.server", { @@ -85,7 +85,7 @@ if action == "login" then end if action == "logout" then - settings.set("auth.token", nil) + settings.set("auth.token", -1) settings.save() io.write("Logged out\n") return diff --git a/auth_server.lua b/auth_server.lua index c7016a9..8a11f68 100644 --- a/auth_server.lua +++ b/auth_server.lua @@ -104,7 +104,7 @@ while true do end if request.action == "token" then - if request.token == nil or request.token == "" then + if request.token == nil or request.token == "" or request.token == -1 then rednet.send(client_id, "invalid request", "auth") else