about summary refs log tree commit diff
path: root/filters
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-01-16 23:21:54 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2014-01-16 23:21:54 +0100
commita431326e8fab8153905fbde036dd3c9fb4cc8eaa (patch)
treeeaff3c6984a1c518c0180d5437853243ca6346a4 /filters
parentauth: lua string comparisons are time invariant (diff)
downloadcgit-pink-a431326e8fab8153905fbde036dd3c9fb4cc8eaa.tar.gz
cgit-pink-a431326e8fab8153905fbde036dd3c9fb4cc8eaa.zip
auth: have cgit calculate login address
This way we're sure to use virtual root, or any other strangeness
encountered.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'filters')
-rw-r--r--filters/simple-authentication.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/filters/simple-authentication.lua b/filters/simple-authentication.lua
index 5c4f074..9291302 100644
--- a/filters/simple-authentication.lua
+++ b/filters/simple-authentication.lua
@@ -122,12 +122,7 @@ function filter_open(...)
 	cgit["repo"] = select(9, ...)
 	cgit["page"] = select(10, ...)
 	cgit["url"] = select(11, ...)
-
-	cgit["login"] = ""
-	for _ in cgit["url"]:gfind("/") do
-		cgit["login"] = cgit["login"] .. "../"
-	end
-	cgit["login"] = cgit["login"] .. "?p=login"
+	cgit["login"] = select(12, ...)
 
 end