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