summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-08-08 09:48:50 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-08-08 09:48:50 +0000
commit7bca24db1b94547d94e0c2e66fa4a819eac7e198 (patch)
treec2f467d1e523eeac2408b9b606a6d991d10cf5a6 /libs/web/luasrc
parentabef50b85238f9effd7e6d6b3195358a84e56ecc (diff)
libs/web: adapt dispatcher to sauth api changes
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r--libs/web/luasrc/dispatcher.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index 7c77f2e97a..9c0bf60b88 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -352,9 +352,6 @@ function dispatch(request)
local user
if sdat then
- sdat = loadstring(sdat)
- setfenv(sdat, {})
- sdat = sdat()
if not verifytoken or ctx.urltoken.stok == sdat.token then
user = sdat.user
end
@@ -376,11 +373,12 @@ function dispatch(request)
local sid = sess or luci.sys.uniqueid(16)
if not sess then
local token = luci.sys.uniqueid(16)
- sauth.write(sid, util.get_bytecode({
+ sauth.reap()
+ sauth.write(sid, {
user=user,
token=token,
secret=luci.sys.uniqueid(16)
- }))
+ })
ctx.urltoken.stok = token
end
luci.http.header("Set-Cookie", "sysauth=" .. sid.."; path="..build_url())