-- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+-- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local require = require
server.challenge = function(user, pass)
local sid, token, secret
+ local config = require "luci.config"
+
if sys.user.checkpasswd(user, pass) then
- local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime })
+ local sdat = util.ubus("session", "create", { timeout = config.sauth.sessiontime })
if sdat then
sid = sdat.ubus_rpc_session
token = sys.uniqueid(16)