From b34c1fcc22e7a972c70fb6cf70ffd7f56d5f18ca Mon Sep 17 00:00:00 2001 From: Kload Date: Sun, 20 Oct 2013 18:25:24 +0200 Subject: [PATCH] Fixes + login style --- access.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/access.lua b/access.lua index a5c4c76..6a43a81 100644 --- a/access.lua +++ b/access.lua @@ -154,9 +154,9 @@ function serve(uri) rel_path = "/login.html" end - content = read_file(script_path.."portal/"..rel_path) + content = read_file(script_path.."portal"..rel_path) if not content then - ngx.exit(ngx.HTTP_NOT_FOUND) + return ngx.exit(ngx.HTTP_NOT_FOUND) end -- Extract file extension @@ -189,12 +189,12 @@ function serve(uri) ngx.header["Cache-Control"] = "no-cache" ngx.say(content) - ngx.exit(ngx.HTTP_OK) + return ngx.exit(ngx.HTTP_OK) end function get_data_for(view) if view == "login.html" then - return { flash = "Meh" } + return { title = "YunoHost Login" } end end @@ -334,7 +334,10 @@ then -- 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 return serve(ngx.var.uri)