mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Fixes + login style
This commit is contained in:
parent
cfae7af501
commit
b34c1fcc22
1 changed files with 8 additions and 5 deletions
13
access.lua
13
access.lua
|
@ -154,9 +154,9 @@ function serve(uri)
|
||||||
rel_path = "/login.html"
|
rel_path = "/login.html"
|
||||||
end
|
end
|
||||||
|
|
||||||
content = read_file(script_path.."portal/"..rel_path)
|
content = read_file(script_path.."portal"..rel_path)
|
||||||
if not content then
|
if not content then
|
||||||
ngx.exit(ngx.HTTP_NOT_FOUND)
|
return ngx.exit(ngx.HTTP_NOT_FOUND)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Extract file extension
|
-- Extract file extension
|
||||||
|
@ -189,12 +189,12 @@ function serve(uri)
|
||||||
|
|
||||||
ngx.header["Cache-Control"] = "no-cache"
|
ngx.header["Cache-Control"] = "no-cache"
|
||||||
ngx.say(content)
|
ngx.say(content)
|
||||||
ngx.exit(ngx.HTTP_OK)
|
return ngx.exit(ngx.HTTP_OK)
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_data_for(view)
|
function get_data_for(view)
|
||||||
if view == "login.html" then
|
if view == "login.html" then
|
||||||
return { flash = "Meh" }
|
return { title = "YunoHost Login" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -334,7 +334,10 @@ then
|
||||||
-- Logout
|
-- Logout
|
||||||
return do_logout()
|
return do_logout()
|
||||||
|
|
||||||
elseif check_cookie() or ngx.var.uri == conf["portal_path"] then
|
elseif check_cookie()
|
||||||
|
or ngx.var.uri == conf["portal_path"]
|
||||||
|
or string.starts(ngx.var.uri, conf["portal_path"].."assets")
|
||||||
|
then
|
||||||
-- Serve normal portal
|
-- Serve normal portal
|
||||||
return serve(ngx.var.uri)
|
return serve(ngx.var.uri)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue