iteration
This commit is contained in:
parent
0510472f3c
commit
a7761faf62
4
auth.lua
4
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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user