summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-07-15 23:25:43 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-07-15 23:28:16 +0200
commit3610f3222d49aa521724fa721b7c5a9ba81f024d (patch)
treebfc275ff7fdf48dc9e04f96e551fa55d2dd37c96
parent16047d03c54df4474cb675a9ce98d06aad5a656b (diff)
luci-mod-rpc: move luci config require into the authentication function (#427)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--modules/luci-mod-rpc/luasrc/controller/rpc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-rpc/luasrc/controller/rpc.lua b/modules/luci-mod-rpc/luasrc/controller/rpc.lua
index 0051571701..129ca43b51 100644
--- a/modules/luci-mod-rpc/luasrc/controller/rpc.lua
+++ b/modules/luci-mod-rpc/luasrc/controller/rpc.lua
@@ -43,14 +43,14 @@ function rpc_auth()
local ltn12 = require "luci.ltn12"
local util = require "luci.util"
- require "luci.config"
-
local loginstat
local server = {}
server.challenge = function(user, pass)
local sid, token, secret
+ require "luci.config"
+
if sys.user.checkpasswd(user, pass) then
local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime })
if sdat then