From 49f60f04951ed1b69837b7d21553597803c209a9 Mon Sep 17 00:00:00 2001 From: lxsang Date: Fri, 26 Jun 2020 15:20:17 +0200 Subject: [PATCH] fix auth bug --- os/libs/common.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/libs/common.lua b/os/libs/common.lua index 764ec62..665c672 100644 --- a/os/libs/common.lua +++ b/os/libs/common.lua @@ -13,6 +13,7 @@ function die (msg) fail(msg) debug.traceback=nil error("Permission denied") + return false end -- check if the sysdb is create, otherwise create the table @@ -33,7 +34,7 @@ function is_auth() local data = db:find(cond) --print(JSON.encode(data)) db:close() - if data == nil or data[1] == nil then die(msg) end + if data == nil or data[1] == nil then return die("No user data found") end -- next time check the stamp SESSION.user = data[1].username return true