From a44d12fa038be336eed30f4b4bd3ee1e305adf55 Mon Sep 17 00:00:00 2001 From: lxsang Date: Mon, 4 Oct 2021 22:10:14 +0200 Subject: [PATCH] update keychain if exists --- os/libs/common.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/os/libs/common.lua b/os/libs/common.lua index e32a12e..23a27ec 100644 --- a/os/libs/common.lua +++ b/os/libs/common.lua @@ -1,4 +1,5 @@ require("sqlite") +local TUNNEL_KEYCHAIN = "/opt/www/tmp/channels/antunnel_keychain" function fail(msg) std.custom_header("Connection","close") std.json() @@ -48,6 +49,10 @@ function is_auth() 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 + local f = io.open(TUNNEL_KEYCHAIN, "w") + if f then + f:write(sessionid) + end return true end