Kill session on logout
This commit is contained in:
parent
8b978f79fc
commit
509a3daadb
2 changed files with 12 additions and 0 deletions
|
@ -49,6 +49,12 @@ function index()
|
|||
end
|
||||
|
||||
function action_logout()
|
||||
local dsp = require "luci.dispatcher"
|
||||
local sauth = require "luci.sauth"
|
||||
if dsp.context.authsession then
|
||||
sauth.kill(dsp.context.authsession)
|
||||
end
|
||||
|
||||
luci.http.header("Set-Cookie", "sysauth=; path=/")
|
||||
luci.http.redirect(luci.dispatcher.build_url())
|
||||
end
|
|
@ -40,6 +40,12 @@ function index()
|
|||
end
|
||||
|
||||
function action_logout()
|
||||
local dsp = require "luci.dispatcher"
|
||||
local sauth = require "luci.sauth"
|
||||
if dsp.context.authsession then
|
||||
sauth.kill(dsp.context.authsession)
|
||||
end
|
||||
|
||||
luci.http.header("Set-Cookie", "sysauth=; path=/")
|
||||
luci.http.redirect(luci.dispatcher.build_url())
|
||||
end
|
Loading…
Reference in a new issue