luci-lua-runtime: fix legacy luci-mod-rpc authentication
authorJo-Philipp Wich <jo@mein.io>
Sat, 29 Apr 2023 22:19:35 +0000 (00:19 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 29 Apr 2023 22:28:18 +0000 (00:28 +0200)
The split of the former `sysauth` cookie into `sysauth_http` and
`sysauth_https` ones was also imposed upon the RPC module, without
leaving the option to use just `sysauth` in place, so allow this cookie
name again for the legacy RPC logins.

Fixes: #6333
Fixes: e1932592c3 ("luci-base: use different cookie names for HTTP and HTTPS")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 2a9c3a3173e0cec686fb8d9fafb8c063f80958e4)

modules/luci-base/luasrc/dispatcher.lua

index b190f5302f68bee4de533f0ed61fd6ab5aad76ff..afd6d9b12ef973b507b01e20d31bf5ce7734b3d5 100644 (file)
@@ -348,7 +348,7 @@ local function tree_to_json(node, json)
                                elseif subname == "rpc" and subnode.module == "luci.controller.rpc" then
                                        spec.auth = {
                                                login = false,
-                                               methods = { "query:auth", "cookie:sysauth_https", "cookie:sysauth_http" }
+                                               methods = { "query:auth", "cookie:sysauth_https", "cookie:sysauth_http", "cookie:sysauth" }
                                        }
                                elseif subnode.module == "luci.controller.admin.uci" then
                                        spec.auth = {