From 72601ca556210e1d06e05a03e11ac87fd4903aee Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Mon, 2 Nov 2026 19:06:38 -1000 Subject: Say when logins are unavailable The way back was signed part way through the form, so while the secret's directory did not exist, or a library was missing, cgit's error landed inside the hidden input and the page broke off there with no fields. --- tests/extensions/test-auth.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests/extensions/test-auth.lua') diff --git a/tests/extensions/test-auth.lua b/tests/extensions/test-auth.lua index 974544d..3a4fabf 100644 --- a/tests/extensions/test-auth.lua +++ b/tests/extensions/test-auth.lua @@ -302,6 +302,18 @@ h.contains("a failed login says so", out, "") h.equals("and leaves the flag out of the way back", way_back_in(out), "/repo/log/?q=x") +-- The real get_secret, pointed at a directory nobody made, cannot sign the +-- way back, so the page says so whole rather than breaking off in the form. +h.load_with(script, { { "local secret_filename = \"/var/lib/cgit/auth-secret\"", + "local secret_filename = \"no-such-directory/auth-secret\"" } }) +out = run_action("body", {}) +h.contains("a secret that cannot be made leaves a page saying so", out, + "") +h.excludes("with no form to fill in", out, "