From: Jo-Philipp Wich Date: Wed, 15 Jul 2015 21:25:43 +0000 (+0200) Subject: luci-mod-rpc: move luci config require into the authentication function (#427) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69fd4f14eef783076b69315c71fe57baad1f8925;p=oweals%2Fluci.git luci-mod-rpc: move luci config require into the authentication function (#427) Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-rpc/luasrc/controller/rpc.lua b/modules/luci-mod-rpc/luasrc/controller/rpc.lua index 005157170..129ca43b5 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