From 0271d6e5bafebad8e94056b99df0ce81f56741fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 24 Oct 2018 22:02:24 +0200 Subject: Add rule for free access to index page. --- hugo-authentication.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hugo-authentication.lua b/hugo-authentication.lua index 6f99df5..4a56bd2 100644 --- a/hugo-authentication.lua +++ b/hugo-authentication.lua @@ -113,6 +113,11 @@ end function authenticate_cookie() printenv("Authenticate Cookie\n===================\n"); + -- Everyone has access to the index page. + if os.getenv("CGIT_REPO_NAME") == nil then + return 1 + end + -- accepted_users = protected_repos[cgit["repo"]] if public_repos[cgit["repo"]] then -- We return as valid if the repo is not protected. -- cgit v1.2.3