From a44988a120a095df7fb72791be51906b7ffb767e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 31 Jan 2024 01:30:11 +0100 Subject: [PATCH] Epic bug because some vars not initialized as nil --- access.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/access.lua b/access.lua index 114fe91..8291bca 100644 --- a/access.lua +++ b/access.lua @@ -97,6 +97,10 @@ end -- - and/or auth_headers is enabled for this app -- ########################################################################### +local is_logged_in = nil +local authUser = nil +local authPasswordEnc = nil + function check_authentication() -- cf. src/authenticators/ldap_ynhuser.py in YunoHost to see how the cookie is actually created @@ -221,7 +225,7 @@ if permission == nil then -- permission is public = everybody has access, no need to check auth elseif permission["public"] then logger:debug("Someone tries to access "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")") - has_access = true + has_access = true -- Check auth header, assume the route is protected else is_logged_in, authUser, authPasswordEnc = check_authentication()