diff options
Diffstat (limited to 'modules/luci-base/ucode/dispatcher.uc')
-rw-r--r-- | modules/luci-base/ucode/dispatcher.uc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 1d10d7876d..805abc4ce0 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -925,6 +925,14 @@ dispatch = function(_http, path) { resolved.ctx.authtoken ??= session.data?.token; resolved.ctx.authuser ??= session.data?.username; resolved.ctx.authacl ??= session.acls; + + /* In case the Lua runtime was already initialized, e.g. by probing legacy + * theme header templates, make sure to update the session ID of the uci + * module. */ + if (runtime.L) { + runtime.L.invoke('require', 'luci.model.uci'); + runtime.L.get('luci', 'model', 'uci').invoke('set_session_id', session.sid); + } } if (length(resolved.ctx.acls)) { |